admin管理员组文章数量:1202391
I created an app and granted it SharePoint REST API permission (not Graph API), specifically SharePoint.Read.All
.
In the SharePoint Admin Center, I created a new site (let's call it "Site A").
When I tried to fetch the list details from this main site, I received an UnauthorizedAccessException
.
However, when I created a subsite under this site (let's call it "Subsite A") and used the same app and code, it was able to fetch the lists successfully.
To fetch all lists of the main site, I had to grant the Sites.FullControl.All
permission.
Why is this behavior occurring? I tested with different site types, but the behavior is consistent—working with subsites but not with the main site. Is it even possible to fetch the SharePoint lists of a main site without using FullControl?
Tested with differnt sites types.
I created an app and granted it SharePoint REST API permission (not Graph API), specifically SharePoint.Read.All
.
In the SharePoint Admin Center, I created a new site (let's call it "Site A").
When I tried to fetch the list details from this main site, I received an UnauthorizedAccessException
.
However, when I created a subsite under this site (let's call it "Subsite A") and used the same app and code, it was able to fetch the lists successfully.
To fetch all lists of the main site, I had to grant the Sites.FullControl.All
permission.
Why is this behavior occurring? I tested with different site types, but the behavior is consistent—working with subsites but not with the main site. Is it even possible to fetch the SharePoint lists of a main site without using FullControl?
Tested with differnt sites types.
Share Improve this question asked Jan 21 at 7:51 AmitAmit 759 bronze badges1 Answer
Reset to default 0The behavior you're experiencing is likely due to the permissions model in SharePoint. The SharePoint.Read.All permission allows your app to read items in all site collections, but it may not grant access to the main site collection in certain contexts, especially if there are additional security settings or restrictions in place.
When you created a subsite, the permissions model may have allowed the app to inherit permissions from the parent site, which is why you were able to fetch the lists successfully. However, the main site may have specific permissions that restrict access, resulting in the UnauthorizedAccessException.
To fetch all lists of the main site without encountering permission issues, granting Sites.FullControl.All is indeed a more comprehensive approach, as it provides the necessary permissions to manage and access all aspects of the site, including lists.
In summary, while it may be possible to fetch lists from the main site with the right permissions, the SharePoint.Read.All permission alone may not suffice due to the specific security configurations of the main site.
本文标签: Issue with Fetching SharePoint Main Site Lists Using SharePointReadAll PermissionStack Overflow
版权声明:本文标题:Issue with Fetching SharePoint Main Site Lists Using SharePoint.Read.All Permission - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738647680a2104684.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论