SharePoint GET /roleassignments REST API returns 403 Forbidden Error

BrajMohan Singh 1 Reputation point
2020-12-23T10:36:23.277+00:00

Hi,

We have a requirement to retrieve RoleAssignments for a SharePoint Site using following REST API:

GET <Site_URL>/_api/web/roleassignments?$expand=Member/users,RoleDefinitionBindings

But this API is retuning 403 Forbidden error:

{
    "odata.error": {
        "code": "-2147024891, System.UnauthorizedAccessException",
        "message": {
            "lang": "en-US",
            "value": "Access denied. You do not have permission to perform this action or access this resource."
        }
    }
}

Does a user need administrator access to retrieve RoleAssignments or what access user need in order to fetch these details using REST API?

Any leads will be appreciated.

Note- The user with which we are trying to fetch RoleAssignments using REST API is a non-admin user.

Thanks,

Brajmohan Singh

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,665 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dattatray Patil 86 Reputation points
    2021-02-03T10:23:30.883+00:00

    I checked this with full control with user access but not able to retrieve the permission.

    I believe you need site collection administrator access to retrieve the role "RoleAssignment".

    Hope this answers your question.

    0 comments No comments