Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
188 views
in Technique[技术] by (71.8m points)

.net - Microsoft Graph API Get all Permissions for library

I am trying to get all the permissions list for the library. But it looks different from what I see on UI part and what I retrieve using Microsoft Graph.

 var permissions = graphClient.Drives[drive.Id].Root.Permissions.Request().GetAsync();

It returns a list of permissions. But for the library, we have users and groups who has "Limited access".

enter image description here

If i will loop for each item in the library and take permissions for each of them in a result list will be not full also. Do someone know how solved it?

question from:https://stackoverflow.com/questions/65850431/microsoft-graph-api-get-all-permissions-for-library

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Unfortunately, you will not be able to get the permissions at higher level - you will have to go through each item and get a unique permission at the item level and then gather the list.

You mentioned that , you may not be able to get the full list - I could think of edge that will cause this.

/sites/{siteId}/drive/items/{itemId}/permissions

Alternatively, if you like to know all the users - at the site level - you can query the User information list using the Sharepoint ReST API.

   _api/Web/lists/getbytitle('User Information List')/getitems

You could filter for all active users - this will not provide the permisssions possesed by them - but gives a list of users added to the site.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...