简体   繁体   English

Microsoft Graph API 获取库的所有权限

[英]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.但它看起来与我在 UI 部分看到的以及我使用 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".但是对于图书馆,我们有“有限访问”的用户和组。

在此处输入图像描述

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?有人知道如何解决吗?

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.不幸的是,您将无法获得更高级别的权限 - 您必须通过每个项目 go 并在项目级别获得唯一权限,然后收集列表。

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.或者,如果您想了解所有用户 - 在站点级别 - 您可以使用 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.您可以过滤所有活动用户 - 这不会提供他们拥有的权限 - 但会提供添加到站点的用户列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM