SharePoint uses role ID’s to create the permissions levels for SharePoint Groups. These role ID’s are a set of numbers that define the precise permissions level details.
The most used role ID are for Visitors (Read), Members (Contribute) and Owners (Full control). When you need other permission levels, creating the correct numbers can be difficult. With the help of the following steps it will be easy to create/find the role ID’s you need. This solution works for SharePoint Online and SharePoint 2013. The role ID’s are used when setting permissions using a rest call, see the blog post SharePoint 2013 Workflow: Changing Permissions with REST Calls for the details.
Permissions level | Role ID |
Full Control | 1073741829 |
Contribute | 1073741827 |
Read | 1073741826 |
Solution
- Open the SharePoint 2013 or Online site.
- Create the required Permission level on the Site Collection
- Go Site Settings – Site Permissions
- Open the Permission Levels
- Create a custom permission level, in this example I created a permission level called Custom Contribute.
- Now we need to find the corresponding role ID
- Create the following URL for your farm / site
https://contoso.sharepoint.com/sites/dev/_api/web/roledefinitions
- This will open a page which looks like an RSS feed.
- Right click on the page to View Source, this will open the Source in Notepad.
- Now copy the code into your favorite XML editor.
- Search the XLM for the correct entry
- The Role ID is located in the link tag. The Role ID for my custom permission level is 1073741927
- The Role ID can now be used in web services, see the blog post SharePoint 2013 Workflow: Changing Permissions with REST Calls for the details.
Hello,
First of all thank you for the tutorial. I’m having a problem with the SP.Web.ShareObject method.
It requires a parameter “roleValue” which normally shoul accept any role id (from what I saw in other topics), but I’m getting a “selected permission level is not valid” error message.
Do you know perhaps the reason ?
Thanks.