0
votes

When I share a file by chat(P2P) in Microsoft Teams app, the file is stored in the OneDrive , so if I interested to remove permission from a specific user that I sent him the file before, I can do this: Getting the users that have permissions with this request:

GET/ https://graph.microsoft.com/v1.0/users/{userId}/drive/items/{itemId}/permissions

It give me all the users that have the permission,so I choose the one that I want to remove it and use this request:

DELETE/ https://graph.microsoft.com/v1.0/users/{userId}/drive/items/{itemId}/permissions/{permissionId}

It's working wonderful. Now I'm interested to do the same with a file that has shared through a Team in Microsoft Team app. But when I check the permissions file with this request:

GET/ https://graph.microsoft.com/v1.0/groups/{groupId}/drive/items/{itemId}/permissions It's not return me permissions for each member on the Team. So my question how it is possible to remove file permissions from a specific member on the Team?

Thanks,

1

1 Answers

0
votes

While files shared in a P2P chat are stored in OneDrive, files shared within Team spaces are stored in a SharePoint Document Repository. Permissions on the SharePoint document repository are group based, and use the Azure AD group for the Team. If you want to remove an individual's permissions for files shared to a Team, they would need to be removed from the group (which would remove their access to everything else for the Team as well).