SharePoint Rest API Giving "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" Error

Anonymous
2022-10-12T05:20:10.097+00:00

SharePoint Rest API Giving "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" Error

https://{tenant}/sites/{sitename}/_api/web/roleassignments?$expand=Member/users,RoleDefinitionBindings

The same API works on different site collection.

Below is the Permission on site 1 :
249559-image.png

Permission on site 2 :
249518-image.png

Microsoft 365 and Office SharePoint Development
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2022-10-12T07:48:01.79+00:00

    Hi @Anonymous
    Full Control, Limited Access is just how SharePoint displays permissions. It means that the user has permissions to an object with custom permissions. At the same time, the user is a member of a site group or possesses individual permissions that provide full control permissions. SharePoint will provide the user with the least-restrictive permission set available for that object. In the two site, the Full Control, Limited Access might have different permission level. So one of them will return Access is denied. Please try to remove the user from the site first and grant the user permission again.

    Here is the details for limited access
    https://learn.microsoft.com/en-us/SharePoint/sites/user-permissions-and-permission-levels?redirectedfrom=MSDN


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments

  2. Anonymous
    2022-10-12T15:11:37.417+00:00

    Hi Ray,

    I have already removed and readded the user to the effected site but it still gives the same error.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.