Quantcast
Channel: Dynamics 365 Customer Engagement
Viewing all articles
Browse latest Browse all 286

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

$
0
0

Hi,


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 = newRetrievePrincipalAccessRequest();
// record for which we want to check the access
retrieveRequest.Target = newEntityReference("opportunity", newGuid("A9F18D5F-6A08-E611-80DE-000D3AA03DA0"));
// User or Team entity Reference
retrieveRequest.Principal = newEntityReference("systemuser", newGuid("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

Gopinath

Viewing all articles
Browse latest Browse all 286

Trending Articles