Skip to content

Commit df2b390

Browse files
authored
Merge pull request #28455 from microsoftgraph/author-api-docs-rbac-handling
author-api-docs: Add handling for Entra admin roles
2 parents 5984069 + 6de7cac commit df2b390

5 files changed

Lines changed: 97 additions & 2 deletions

File tree

.github/prompts/author-api-docs/common.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ Fully qualify any type (including enum types) that is defined in a subnamespace
407407
**Permissions:**
408408
- Must start with the standard boilerplate text
409409
- Must include link to a permissions table
410+
- **(Optional) RBAC include:** If the documentation plan or author specifies required Entra admin roles, add an RBAC include statement immediately after the permissions table include. See [RBAC for APIs include file templates](../../../templates/rbac-for-apis-include.md) for file conventions, naming, and content templates.
410411

411412
**HTTP request:**
412413
- Use relative URLs (e.g., `/users` not `https://graph.microsoft.com/beta/users`)
@@ -691,6 +692,7 @@ After processing all files in a documentation session, verify cross-file consist
691692
2. **API file ↔ resource link:** Every API file's description should link back to its parent resource, and that resource file should exist
692693
3. **Enum references ↔ definitions:** Every enum type referenced in Properties tables should be defined in the appropriate enums file, parent resource, or separate topic
693694
4. **Permissions files:** Every permissions include reference in API files should have a corresponding file in the `includes/permissions/` folder
695+
5. **RBAC files:** If any API file has an RBAC include reference, verify the corresponding file exists in `includes/rbac-for-apis/`
694696
5. **JSON representation ↔ Properties table:** Properties listed in the JSON representation section should match the Properties table
695697
6. **Polymorphic collections:** If a Documentation Plan flagged polymorphic types, verify: (a) no operation files were created using derived type names, (b) all shared operation files use the base type name, (c) base type resource page has the Methods table (including base-type-only operations for concrete bases), (d) derived type resource pages have a `## Methods` section with only a polymorphic note (no Methods table — the table lives only on the base type page), (e) `@odata.type` guidance is included in POST/PATCH request body sections
696698

.github/prompts/author-api-docs/ga.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ The shortest route is to **copy the relevant beta topics** from the `api-referen
111111
- Copy resource files from `api-reference\beta\resources\` to `api-reference\v1.0\resources\`
112112
- Copy API method files from `api-reference\beta\api\` to `api-reference\v1.0\api\`
113113
- Copy permission include files from `api-reference\beta\includes\permissions\` to `api-reference\v1.0\includes\permissions\`
114+
- Copy RBAC include files (if they exist) from `api-reference\beta\includes\rbac-for-apis\` to `api-reference\v1.0\includes\rbac-for-apis\`
114115

115116
### Step 2: Update copied files for v1.0
116117

@@ -300,6 +301,10 @@ In addition to the [base quality checklist](common.md#base-quality-checklist), v
300301
**For permission include files:**
301302
- [ ] Files copied from beta\includes\permissions to v1.0\includes\permissions
302303

304+
**For RBAC include files (if applicable):**
305+
- [ ] Files copied from beta\includes\rbac-for-apis to v1.0\includes\rbac-for-apis
306+
- [ ] If new RBAC info provided but no beta file exists, file created using [RBAC templates](../../../templates/rbac-for-apis-include.md)
307+
303308
**For concept topics (if applicable):**
304309
- [ ] Code examples updated from /beta to /v1.0
305310
- [ ] All "(preview)" references removed from content
@@ -319,6 +324,7 @@ In addition to the [base quality checklist](common.md#base-quality-checklist), v
319324
- [ ] All resource files promoted and updated
320325
- [ ] All API method files promoted and updated
321326
- [ ] All permission files copied
327+
- [ ] All RBAC include files copied (if applicable)
322328
- [ ] All concept topics updated if applicable
323329
- [ ] All TOC entries updated
324330
- [ ] Changelog and What's new updated

.github/prompts/author-api-docs/public-preview.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,14 @@ When API changes involve adding new properties or relationships to an existing r
308308
- `api-reference/v1.0/includes/permissions/`
309309
- Do not make any changes to these permissions files
310310

311-
4. **HTTP request section:**
311+
4. **RBAC include (optional — only when admin role info is provided):**
312+
- If the documentation plan or author specifies required Entra admin roles for the API:
313+
- Create the RBAC include file using the templates in [RBAC for APIs include file templates](../../../templates/rbac-for-apis-include.md)
314+
- Place in `api-reference/{version}/includes/rbac-for-apis/`
315+
- Add the include statement after the permissions table include, before `## HTTP request`
316+
- If no admin role info is provided, skip this step
317+
318+
5. **HTTP request section:**
312319
- Confirm the endpoint matches the endpoints in the API.md
313320
- Correct where you can
314321
- **For actions/functions in subnamespaces:** See [namespace qualification rules](common.md#namespace-qualification) for fully qualifying actions/functions
@@ -559,6 +566,7 @@ In addition to the [base quality checklist](common.md#base-quality-checklist), v
559566
- [ ] Description links back to parent resource (e.g. `Get a [user](../resources/user.md).`)
560567
- [ ] Permissions section unchanged
561568
- [ ] Permissions include file copied to correct includes folder
569+
- [ ] RBAC include file created and added if admin role info was provided
562570
- [ ] HTTP request: Endpoints confirmed against API.md
563571
- [ ] HTTP request: Endpoints match example URL in Examples section except relative URL
564572
- [ ] HTTP request: Actions/functions in subnamespaces are fully qualified

templates/changelog-patterns.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- -This template file is consumed by the /authorAPIDocs prompt -->
12
# Manual Changelog Authoring Guide
23

34
This guide covers how to manually create changelog entries for changes that don't trigger automatic generation (e.g., throttling updates, query capability changes, page size limit changes).
@@ -21,7 +22,7 @@ Each changelog entry must be part of a "ChangeList" array with the following req
2122

2223
| Property | Description | Example Values |
2324
|----------|-------------|----------------|
24-
| **Id** | GUID identifier. Use the same GUID for all related changes in a release. | "6ebc1737-3f93-4ef1-a9e7-cafa03262cf8" |
25+
| **Id** | GUID identifier. Use the same GUID for all related objects in a ChangeList. | "6ebc1737-3f93-4ef1-a9e7-cafa03262cf8" |
2526
| **ApiChange** | The type of Microsoft Graph API element being changed. | "Resource", "Property", "Relationship", "Method", "Enumeration", "Member", "Parameter", "Header", "Permission" |
2627
| **ChangedApiName** | The name of the specific API element that changed. | "user", "displayName", "manager", "delta", "status", "active", "id", "Authorization", "User.Read.All" |
2728
| **ChangeType** | The nature of the change. | "Addition", "Change", "Deletion", "Deprecation" |
@@ -34,6 +35,7 @@ These properties apply to the entire changelog record (not individual ChangeList
3435

3536
| Property | Description | Default Value | Possible Values |
3637
|----------|-------------|---------------|-----------------|
38+
| **Id** | GUID identifier for the changelog record. Use the same GUID as the ChangeList Id. | (None - must specify) | Same GUID as ChangeList Id |
3739
| **Cloud** | The cloud environment where the change is available. | "prd" | "prd" (production) |
3840
| **Version** | The API version where the change is available. | "v1.0" | "v1.0", "beta" |
3941
| **CreatedDateTime** | UTC timestamp when the changelog entry was created. Use PowerShell: `(Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ")` | Current UTC datetime | "2025-11-17T17:38:10.4694969Z" (ISO 8601/RFC 3339 format with fractional seconds) |

templates/rbac-for-apis-include.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<!-- -This template file is consumed by the /authorAPIDocs prompt -->
2+
# RBAC for APIs include file templates
3+
4+
Use these templates when creating RBAC (role-based access control) include files for API operation topics. These files inform callers which Microsoft Entra admin roles are required in delegated scenarios, in addition to Microsoft Graph permissions.
5+
6+
## File conventions
7+
8+
- **Location:** `api-reference/{version}/includes/rbac-for-apis/`
9+
- **Naming:** `rbac-{feature-area}-apis-{operation}.md` — for example, `rbac-identity-provider-apis.md`, `rbac-access-reviews-apis-read.md`
10+
- **Placement in API file:** Immediately after the permissions table include statement, before the `## HTTP request` section
11+
12+
### Include syntax in API operation files
13+
14+
```markdown
15+
[!INCLUDE [rbac-{descriptive-label}](../includes/rbac-for-apis/{filename}.md)]
16+
```
17+
18+
---
19+
20+
## Template A — Single least privileged role
21+
22+
Use when one Entra admin role is the least privileged role for the operation.
23+
24+
```markdown
25+
---
26+
author: {github-username}
27+
ms.topic: include
28+
---
29+
30+
> [!IMPORTANT]
31+
> In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported [Microsoft Entra role](/entra/identity/role-based-access-control/permissions-reference?toc=%2Fgraph%2Ftoc.json) or a custom role with a supported role permission. *{Role Name}* is the least privileged role supported for this operation.
32+
```
33+
34+
### Example (Template A)
35+
36+
```markdown
37+
---
38+
author: janedoe
39+
ms.topic: include
40+
---
41+
42+
> [!IMPORTANT]
43+
> In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported [Microsoft Entra role](/entra/identity/role-based-access-control/permissions-reference?toc=%2Fgraph%2Ftoc.json) or a custom role with a supported role permission. *External Identity Provider Administrator* is the least privileged role supported for this operation.
44+
```
45+
46+
---
47+
48+
## Template B — Multiple least privileged roles
49+
50+
Use when two or more Entra admin roles are supported for the operation, listed from least to most privileged.
51+
52+
```markdown
53+
---
54+
author: {github-username}
55+
ms.topic: include
56+
---
57+
58+
> [!IMPORTANT]
59+
> In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported [Microsoft Entra role](/entra/identity/role-based-access-control/permissions-reference?toc=%2Fgraph%2Ftoc.json) or a custom role with a supported role permission. The following least privileged roles are supported for this operation.
60+
> - {Role Name 1}
61+
> - {Role Name 2}
62+
> - {Role Name 3}
63+
```
64+
65+
### Example (Template B)
66+
67+
```markdown
68+
---
69+
author: janedoe
70+
ms.topic: include
71+
---
72+
73+
> [!IMPORTANT]
74+
> In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported [Microsoft Entra role](/entra/identity/role-based-access-control/permissions-reference?toc=%2Fgraph%2Ftoc.json) or a custom role with a supported role permission. The following least privileged roles are supported for this operation.
75+
> - Cloud Application Administrator
76+
> - Application Administrator
77+
```

0 commit comments

Comments
 (0)