I have been spending some time with REST APIs when working with SharePoint 2013. Today I am going to share with you some RESP API code samples related to getting SharePoint Site/List/List Item permissions using the REST API.
To get permission for specific site for particular user you can use
http://intranet.contoso.com/_api/web/getusereffectivepermissions(@user)?@user=%27i%3A0%23%2Ew%7Ccontoso%5Cbrianc%27
Here the username is in this format i:0#.w|contoso\brianc for Windows Claims. This will change for SAML Claim
To get specific list permission for particular users you can use
http://intranet.contoso.com/_api/web/lists(guid’F27BDE7D-340F-43F4-B606-D24E02D0D01C’)/getusereffectivepermissions(@user)?@user=’i%3A0%23%2Ew%7Ccontoso%5Cbrianc’
And finally to get permission for a list item for particular user you can use
http://intranet.contoso.com/_api/web/lists(guid’F27BDE7D-340F-43F4-B606-D24E02D0D01C’)/getitembyid(16)/getusereffectivepermissions(@user)?@user=’i%3A0%23%2Ew%7Ccontoso%5Cbrianc’
Over next few months I will be sharing few more blog posts on REST API HOW TO Series.
Cheers.