我正在尝试访问作为嵌套子站点一部分的列表的项目,如下所示:
https://{mytenant}.sharepoint.com/
vendorSiteCollection/
vendorAppSite/
vendorList
我的测试用户 只有对
vendorAppSite
的读取权限子站点。我已经删除了所有其他站点的读取权限,包括 root
网站集在 https://{mytenant}.sharepoint.com
.如果我在浏览器中导航到这里:
https://{mytenant}.sharepoint.com/sites/{vendorSiteCollection}/{vendorAppSite}/Lists/{vendorList}/AllItems.aspx
然后我看到了列表,正如预期的那样。
但是,当我在 Graph Explorer 中发出此请求时:
https://graph.microsoft.com/v1.0/sites/root:/sites/{vendorSiteCollection}/{vendorAppSite}:/lists/{vendorList}?$expand=items($expand=fields)
我收到 403 禁止响应:
{
"error": {
"code": "accessDenied",
"message": "The caller does not have permission to perform the action.",
"innerError": {
"request-id": "15e2087d-8ae5-46e3-abee-4ab165629dfb",
"date": "2018-04-05T12:08:16"
}
}
}
我本来希望能够通过 API 读取列表项,就像我可以在 SharePoint Online UI 中看到列表项一样。
像这样设置权限级别时,如何使用 Microsoft Graph API 读取项目?
旁注:当测试用户对
root
具有读取权限时网站集在 https://{mytenant}.sharepoint.com
,API 按预期工作。但是这种解决方法对我们不起作用,因为我们不希望我们的用户对 root
具有读访问权限。网站集。
最佳答案
这个问题似乎在 MS Graph 中得到解决。
关于microsoft-graph-api - Microsoft Graph - 为什么访问另一个网站集中的子网站需要根网站读取权限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49672387/