-
Notifications
You must be signed in to change notification settings - Fork 487
Added Documentation Page for Bulk Container Permission Creation via D… #9873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
RushwantKoppolu
wants to merge
2
commits into
microsoftgraph:main
from
RushwantKoppolu:user/rkoppolu/GraphDocumentationDeltaPatchCreatePermission
+207
−0
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
196 changes: 196 additions & 0 deletions
196
api-reference/beta/api/filestoragecontainer-deltapatch-permissions.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,196 @@ | ||
| --- | ||
| title: "Delta patch permissions" | ||
| description: "Use delta patch to bulk manage permissions on a fileStorageContainer." | ||
| author: "RushwantKoppolu" | ||
| ms.localizationpriority: medium | ||
| ms.subservice: "onedrive" | ||
| doc_type: apiPageType | ||
| ms.date: 04/22/2026 | ||
| --- | ||
|
|
||
| # Delta patch permissions | ||
|
|
||
| Namespace: microsoft.graph | ||
|
|
||
| [!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)] | ||
|
|
||
| Add up to 10 [permission](../resources/permission.md) objects to an existing [fileStorageContainer](../resources/filestoragecontainer.md) in a single request using delta patch. | ||
|
|
||
| > [!NOTE] | ||
| > Currently, we only support bulk **creating** permissions. Bulk updating and deleting permissions will be supported in the future. | ||
| > [!IMPORTANT] | ||
| > Permissions added to a [fileStorageContainer](../resources/filestoragecontainer.md) apply to all its [driveItem](../resources/driveitem.md) objects, regardless of any unique or restrictive permissions applied to those items. | ||
|
|
||
| [!INCLUDE [national-cloud-support](../../includes/all-clouds.md)] | ||
|
|
||
| ## Permissions | ||
|
|
||
| Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions [only if your app requires it](/graph/permissions-overview#best-practices-for-using-microsoft-graph-permissions). For details about delegated and application permissions, see [Permission types](/graph/permissions-overview#permission-types). To learn more about these permissions, see the [permissions reference](/graph/permissions-reference). | ||
|
|
||
| <!-- { "blockType": "permissions", "name": "filestoragecontainer_deltapatch_permissions" } --> | ||
| [!INCLUDE [permissions-table](../includes/permissions/filestoragecontainer-deltapatch-permissions-permissions.md)] | ||
|
|
||
| [!INCLUDE [app-permissions](../includes/sharepoint-embedded-app-permissions.md)] | ||
|
|
||
| ## HTTP request | ||
|
|
||
| <!-- { | ||
| "blockType": "ignored" | ||
| } | ||
| --> | ||
| ```HTTP | ||
| PATCH /storage/fileStorage/containers/{containerId}/permissions | ||
| ``` | ||
|
|
||
| ## Request headers | ||
|
|
||
| |Name|Description| | ||
| |:---|:---| | ||
| |Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).| | ||
| |Content-Type|application/json. Required.| | ||
|
|
||
| ## Request body | ||
|
|
||
| In the request body, supply a JSON object with the following properties. | ||
|
|
||
| |Name|Type|Description| | ||
| |:---|:---|:---| | ||
| |@context|String|Must be set to `#$delta` to signal a delta patch operation. Required.| | ||
| |value|[permission](../resources/permission.md) collection|A collection of up to 10 permission objects to process. Required.| | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Collection(permission) like the roles? |
||
|
|
||
| Each [permission](../resources/permission.md) object in the **value** collection supports the following properties. | ||
|
|
||
| |Name|Type|Description| | ||
| |:---|:---|:---| | ||
| |roles|Collection(String)|The type of permission to grant. The possible values are: `reader`, `writer`, `manager`, `owner`.| | ||
| |grantedToV2|[sharePointIdentitySet](../resources/sharepointidentityset.md)|For user type permissions, the details of the user for this permission.| | ||
|
|
||
| ## Response | ||
|
|
||
| If successful, this method returns a `200 OK` response code and a collection of [permission](../resources/permission.md) objects in the response body. Successfully processed permissions include the permission object. Failed items include a `@Core.DataModificationException` annotation with error details. | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Request | ||
|
|
||
| The following example shows how to add three permissions to a container in a single request. | ||
|
|
||
| <!-- { | ||
| "blockType": "request", | ||
| "name": "deltapatch_permissions" | ||
| } | ||
| --> | ||
| ```http | ||
| PATCH https://graph.microsoft.com/beta/storage/fileStorage/containers/b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z/permissions | ||
| Content-Type: application/json | ||
|
|
||
| { | ||
| "@context": "#$delta", | ||
| "value": [ | ||
| { | ||
| "roles": ["reader"], | ||
| "grantedToV2": { | ||
| "user": { | ||
| "userPrincipalName": "jacob@contoso.com" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "roles": ["manager"], | ||
| "grantedToV2": { | ||
| "user": { | ||
| "userPrincipalName": "alex@contoso.com" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "roles": ["writer"], | ||
| "grantedToV2": { | ||
| "user": { | ||
| "userPrincipalName": "kate@contoso.com" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| ### Response | ||
|
|
||
| The following example shows the response. The first two permissions were created successfully. The third failed because the user wasn't found, as indicated by the `@Core.DataModificationException` annotation. | ||
|
|
||
| >**Note:** The response object shown here might be shortened for readability. | ||
|
|
||
| <!-- { | ||
| "blockType": "response", | ||
| "truncated": true, | ||
| "@odata.type": "Collection(microsoft.graph.permission)" | ||
| } | ||
| --> | ||
| ```http | ||
| HTTP/1.1 200 OK | ||
| Content-Type: application/json | ||
|
|
||
| { | ||
| "@odata.context": "https://graph.microsoft.com/beta/$metadata#storage/fileStorage/containers('b%21ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z')/permissions/$delta", | ||
| "value": [ | ||
| { | ||
| "id": "X2k6MCMuZnxtZW1iZXJzaGlwfGpha2VzbWl0aEBjb250b3NvLm9ubWljcm9zb2Z0LmNvbQ", | ||
| "roles": [ | ||
| "reader" | ||
| ], | ||
| "grantedToV2": { | ||
| "user": { | ||
| "displayName": "Jacob Hancock", | ||
| "id": "12cf37a9-fd2d-463f-a9c4-5a5acfef22df", | ||
| "userPrincipalName": "jacob@contoso.com" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "id": "X2k6MCMuZnxtZW1iZXJzaGlwfGpvaG5kb2VAY29udG9zby5vbm1pY3Jvc29mdC5jb20", | ||
| "roles": [ | ||
| "manager" | ||
| ], | ||
| "grantedToV2": { | ||
| "user": { | ||
| "displayName": "Alex Johnson", | ||
| "id": "97fb19fc-f342-48ab-b945-85eb8b81a732", | ||
| "userPrincipalName": "alex@contoso.com" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "@Core.DataModificationException": { | ||
| "@odata.type": "#Org.OData.Core.V1.DataModificationExceptionType", | ||
| "failedOperation": "Create", | ||
| "responseCode": 400, | ||
| "info": { | ||
| "code": "BadRequest", | ||
| "message": "The specified user kate@contoso.com could not be found." | ||
| } | ||
| }, | ||
| "id": "00000000-0000-0000-0000-000000000000", | ||
| "roles": [ | ||
| "writer" | ||
| ], | ||
| "grantedToV2": { | ||
| "user": { | ||
| "userPrincipalName": "kate@contoso.com" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| ## Error response codes | ||
|
|
||
| |HTTP code|Description| | ||
| |:---|:---| | ||
| |400|Bad request.| | ||
| |401|Request lacks valid authentication credentials.| | ||
| |403|Provided authentication credentials are valid but insufficient to perform requested operation. Examples: the calling app does not have permissions to manage permissions for containers of this type; the calling user has no permissions on this container instance or their role does not allow container permission management.| | ||
| |404|Container doesn't exist.| | ||
| |409|Resource modified. Returned per-item when attempting to add an identity that already has a different role on the container.| | ||
| |423|Container is locked. For example, the container is archived.| | ||
10 changes: 10 additions & 0 deletions
10
...includes/permissions/filestoragecontainer-deltapatch-permissions-permissions.md
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this supposed to be auto-generated? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| ms.topic: include | ||
| ms.localizationpriority: medium | ||
| --- | ||
|
|
||
| |Permission type|Least privileged permissions|Higher privileged permissions| | ||
| |:---|:---|:---| | ||
| |Delegated (work or school account)|FileStorageContainer.Selected|FileStorageContainer.Manage.All| | ||
| |Delegated (personal Microsoft account)|FileStorageContainer.Selected|Not available.| | ||
| |Application|FileStorageContainer.Selected|Not available.| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.