Permissions of the User on a record – RetrievePrincipalAccessRequest in CRM 2001//2013/2015/2016


Today we got a requirement what are the permissions of the user on a particular record. To fullfill this requirement, there is a SDK message called “RetrievePrincipalAccessRequest”

Here is the sample code of it.

RetrievePrincipalAccessRequest retrieveRequest = new RetrievePrincipalAccessRequest();

// record for which we want to check the access
retrieveRequest.Target = new EntityReference(“opportunity”, new Guid(“A9F18D5F-6A08-E611-80DE-000D3AA03DA0”));
// User or Team entity Reference
retrieveRequest.Principal = new EntityReference(“systemuser”, new Guid(“1C5A2AE8-AD00-E611-80DD-000D3AA03DA0”));
RetrievePrincipalAccessResponse retrieveResponse = (RetrievePrincipalAccessResponse)crmSerivce.Execute(retrieveRequest);

In the response we get the combination of all the rights either through sharing or his own security roles

Hope this helps.

Happy CRM’ing


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s