列出 onedrive 项目权限返回模糊数据

发布于 2025-01-21 01:28:09 字数 2582 浏览 1 评论 0 原文

只要我还没有找到工作解决方案来通过Microsoft Graph API获得SharePoint Online网站权限(返回200个OK和一个空数组),我就试图获得绑定到该站点的OneDrive资源的权限。 根据手册 我正在尝试使用这样的查询来获取位于网站序列上的项目的OneDrive项目权限:

get/drives/somedriveId/someedriveId/someitemid/permissions

该结果包含我无法理解的数据

[{'id': 'cm9kaW4gT3duZXJz',
  'roles': ['owner'],
  'grantedToV2': {'siteGroup': {'displayName': 'MYSITE Owners',
    'id': '3',
    'loginName': 'MYSITE Owners'}},
  'grantedTo': {'user': {'displayName': 'MYSITE Owners'}},
  'inheritedFrom': {}},
 {'id': 'cm9kaW4gVmlzaXRvcnM',
  'roles': ['read'],
  'grantedToV2': {'siteGroup': {'displayName': 'MYSITE Visitors',
    'id': '4',
    'loginName': 'MYSITE Visitors'}},
  'grantedTo': {'user': {'displayName': 'MYSITE Visitors'}},
  'inheritedFrom': {}},
 {'id': 'cm9kaW4gTWVtYmVycw',
  'roles': ['write'],
  'grantedToV2': {'siteGroup': {'displayName': 'MYSITE Members',
    'id': '5',
    'loginName': 'MYSITE Members'}},
  'grantedTo': {'user': {'displayName': 'MYSITE Members'}},
  'inheritedFrom': {}},
 {'id': 'aTowIy5mfG1lbWJlcnNoaXB8bS5yb2RpbkB0ZWFtLXNlcnZpY2UucnU',
  'roles': ['owner'],
  'grantedToV2': {'user': {'@odata.type': '#microsoft.graph.sharePointIdentity',
    'displayName': 'My Real User Name',
    'email': '[email protected]',
    'id': '08278fd9-dfe5-4c3b-a38e-08f06da2f59b'},
   'siteUser': {'displayName': 'My Real User Name',
    'email': '[email protected]',
    'id': '6',
    'loginName': 'i:0#.f|membership|[email protected]'}},
  'grantedTo': {'user': {'displayName': 'My Real User Name',
    'email': '[email protected]',
    'id': '08278fd9-dfe5-4c3b-a38e-08f06da2f59b'}},
  'inheritedFrom': {}}]

:查询返回的只有有效的用户是我(我是创建者和所有者)。 我添加的其他网站访问者似乎隐藏在“ MySite所有者”,“ Mysite访问者”和“ Mysite成员”后面。 如何揭示这些特定站点组的内容?

As long as I still haven't found a working solution to get Sharepoint Online site permissions through microsoft graph api (which returns 200 OK and an empty array), I am trying to get permissions for the onedrive resource bound to this site.
According to the manual
https://learn.microsoft.com/en-us/graph/api/driveitem-list-permissions?view=graph-rest-1.0&tabs=http
I am trying to get onedrive item permissions for the item located on the site MYSITE using a query like this:

GET /drives/somedriveid/items/someitemid/permissions

The result contains data which I cannot understand:

[{'id': 'cm9kaW4gT3duZXJz',
  'roles': ['owner'],
  'grantedToV2': {'siteGroup': {'displayName': 'MYSITE Owners',
    'id': '3',
    'loginName': 'MYSITE Owners'}},
  'grantedTo': {'user': {'displayName': 'MYSITE Owners'}},
  'inheritedFrom': {}},
 {'id': 'cm9kaW4gVmlzaXRvcnM',
  'roles': ['read'],
  'grantedToV2': {'siteGroup': {'displayName': 'MYSITE Visitors',
    'id': '4',
    'loginName': 'MYSITE Visitors'}},
  'grantedTo': {'user': {'displayName': 'MYSITE Visitors'}},
  'inheritedFrom': {}},
 {'id': 'cm9kaW4gTWVtYmVycw',
  'roles': ['write'],
  'grantedToV2': {'siteGroup': {'displayName': 'MYSITE Members',
    'id': '5',
    'loginName': 'MYSITE Members'}},
  'grantedTo': {'user': {'displayName': 'MYSITE Members'}},
  'inheritedFrom': {}},
 {'id': 'aTowIy5mfG1lbWJlcnNoaXB8bS5yb2RpbkB0ZWFtLXNlcnZpY2UucnU',
  'roles': ['owner'],
  'grantedToV2': {'user': {'@odata.type': '#microsoft.graph.sharePointIdentity',
    'displayName': 'My Real User Name',
    'email': '[email protected]',
    'id': '08278fd9-dfe5-4c3b-a38e-08f06da2f59b'},
   'siteUser': {'displayName': 'My Real User Name',
    'email': '[email protected]',
    'id': '6',
    'loginName': 'i:0#.f|membership|[email protected]'}},
  'grantedTo': {'user': {'displayName': 'My Real User Name',
    'email': '[email protected]',
    'id': '08278fd9-dfe5-4c3b-a38e-08f06da2f59b'}},
  'inheritedFrom': {}}]

The only valid user returned by the query is me (I am the creator and the owner).
The other site visitors which I added seem to hide behind the groups 'MYSITE Owners', 'MYSITE Visitors' and 'MYSITE Members'.
How can reveal the contents of these site specific groups?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

春夜浅 2025-01-28 01:28:09

我也一直在为这个问题而苦苦挣扎。目前,Graph API 不支持此类功能,我们必须使用 SharePoint REST API 来获取这些用户。

有用的链接:

I've been struggeling with this issue as well. Currently, the Graph API does not support such functionality and we have to use the SharePoint REST API to get these users.

Useful links:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文