Skip to content

Latest commit

 

History

History
120 lines (85 loc) · 4.72 KB

File metadata and controls

120 lines (85 loc) · 4.72 KB
author spgraph-docs-team
ms.date 09/10/2017
title Remove access to an item
ms.localizationpriority medium
description Remove access to a DriveItem.
ms.subservice onedrive
doc_type apiPageType

Delete a sharing permission from a file or folder

Namespace: microsoft.graph

Remove access to a driveItem.

Only sharing permissions that aren't inherited can be deleted. The inheritedFrom property must be null.

Important

In SharePoint Embedded, permissions added to a fileStorageContainer can't be removed from its driveItem objects, which means that users and groups with container permissions have access to all items in that container.

[!INCLUDE national-cloud-support]

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. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

[!INCLUDE permissions-table]

HTTP request

DELETE /drives/{drive-id}/items/{item-id}/permissions/{perm-id}
DELETE /groups/{group-id}/drive/items/{item-id}/permissions/{perm-id}
DELETE /me/drive/items/{item-id}/permissions/{perm-id}
DELETE /sites/{site-id}/drive/items/{item-id}/permissions/{perm-id}
DELETE /users/{user-id}/drive/items/{item-id}/permissions/{perm-id}

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.
if-match String. If this request header is included and the eTag (or cTag) provided doesn't match the current tag on the item, a 412 Precondition Failed response is returned and the item isn't deleted.

Response

If successful, this method returns 204 No Content response code.

Example

This example removes the permission identified as {perm-id} from the item {item-id} in the current user's OneDrive.

DELETE https://graph.microsoft.com/v1.0/me/drive/items/{item-id}/permissions/{perm-id}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

HTTP/1.1 204 No Content

Remarks

  • Drives with a driveType of personal (OneDrive Personal) can't create or modify permissions on the root driveItem.