Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Retrieve privileges using security role rather than using system user

Posted on by Microsoft Employee

Here is my code,

                RetrievePrincipalAccessRequest request = new RetrievePrincipalAccessRequest();
                request.Principal = new EntityReference("systemuser", new Guid("GUID of system user record."));
                // record for which we want to check the access
                request.Target = new EntityReference("account", new Guid("GUID of account record."));
                try
                {
                    RetrievePrincipalAccessResponse responce = (RetrievePrincipalAccessResponse)organisationservice.Execute(request);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("error" + ex.Message.ToString());
                }

It take out "can access| can edit| can read" privilege for system user and a security principal can be either user or team but not a security role, therefore is there any C# code which can retrieve privileges using a security role.

I have Dynamic CRM Online instance.

Thanks :-)

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Retrieve privileges using security role rather than using system user

    Hi,

    I found a solution of my question with C# code.

    Here is Link - http://stackoverflow.com/questions/43085227/retrieve-privileges-using-security-role-rather-than-using-system-user

    Thanks

  • Dynamics_Alok Profile Picture
    Dynamics_Alok 1,746 on at
    RE: Retrieve privileges using security role rather than using system user

    Yes ..you can fetch information's (privileges etc) from Security Roles by simply fetching that Security Role entity record.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Retrieve privileges using security role rather than using system user

    Hi Vikas,

    I update my question Please! post any solution if you find.

    Thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: I want to retrieve privileges using security role rather than using system user in dynamic crm online instance

    I know this already which you mention above. Is there any c# code which retrieve privileges using security role. I research too much but I can't find any solution to retrieve privileges using security role.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: I want to retrieve privileges using security role rather than using system user in dynamic crm online instance

    Security principal can be either a user or a team. Check the matadata details here

    msdn.microsoft.com/.../microsoft.crm.sdk.messages.retrieveprincipalaccessrequest.aspx

    This request gives the snapshot of the access rights at that time for a security principal so you cannot search by a role.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans