SharePoint REST-API:获取列表数据而不授予Web权限 [英] SharePoint REST-API: Getting list data without granting permission on web
问题描述
我目前正在开展一个项目,我必须通过SharePoint Rest API(客户端)访问多个列表,包括他们在SharePoint Web(SPFx扩展)中的数据:
I´m currently working on a project where I have to access several lists including their data in a SharePoint Web (SPFx Extension) via SharePoint Rest API (client side):
https://tenant.sharepoint.com/sites/config/_api/web/lists/getByTitle('MyListTitle')
https://tenant.sharepoint.com/sites/config/_api/web/lists/getByTitle('MyListTitle')
WebService调用适用于已阅读的用户root web("/ sites / config")上的权限。
The WebService call works well for a user who has read permission on root web ("/sites/config").
当我在列表中中断角色继承并仅为列表而不是根网站上的用户设置权限时,Web服务返回异常(系统。 UnauthorizedAccessException):
When I break the role inheritance on the list and set permission for a user ONLY on the list and not on the root web, the web service returns an Exception (System.UnauthorizedAccessException):
推荐答案
您好
简而言之,答案是否定的。除非您设置匿名数据,否则必须为执行提供足够的权限。
In short the answer is no. You have to give enough permission for the execution unless you set data anonymous.
但是如果您希望列表是匿名的,则必须先将站点设置为匿名。它无法满足您的要求。
But if you want the list be anonymous, you have to set the site as anonymous first. It cannot meet your requirement.
这篇关于SharePoint REST-API:获取列表数据而不授予Web权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!