只要我还没有找到工作解决方案来通过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?
发布评论
评论(1)
我也一直在为这个问题而苦苦挣扎。目前,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: