web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Hide button based on access to individual entity

(0) ShareShare
ReportReport
Posted on by

The example at [Hide a standard 'out of the box' button based on a users security roles] shows how to show/hide a button based on if a user has global delete permission of contacts, but how do I have it check the 'Write' permission of just the entity that's open instead of a global permission?  I know to change PrivilegeType to 'Write' but what do I set PrivilegeDepth to?  Do I do anything with AppliesTo?  The button I'm trying to show/hide is on the main form and not a subgrid.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hello,

    Please check ribbon xml reference, it will help you define your display rule

    PrivilegeDepth to- Is basically access level of the user that you want to validate.

    Applies To - Is related to form or subgrid, so as your button is on the main form it should be PrimaryEntity

    refer: msdn.microsoft.com/.../gg334239.aspx;MSPPError=-2147217396

  • KG_CRM Profile Picture
    on at

    Your link doesn't work, but I found the reference you were referring to:

    msdn.microsoft.com/.../gg334239.aspx

  • KG_CRM Profile Picture
    on at

    So if the user has Global write access but I set the rule's PrivelegeDepth to Basic, would it return True or False?  I'm guessing and hoping it returns True.

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    As you want to validate if user has basic access level or not, so it will return false if user will have global access, it will only return true in case user will have basic user level access.

    Thanks

  • KG_CRM Profile Picture
    on at

    So to check if a user has basic user access or higher I'll need 4 display rules for Basic, Local, Deep, and Global?  Maybe an Or Rule that has all 4?

  • Mahendar Pal Profile Picture
    45,095 on at

    What is your requirement, when you want to show this button ? which access level you want to check ?

  • KG_CRM Profile Picture
    on at

    I want to show the button if they can write to the record, regardless of privilege depth.  If they cannot write to the record, I don't want to show the button.

    With a different button I also have a need to do the opposite; display it if the user doesn't have write permission, but if I understand how to do one button I can figure out how to do the other.

  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    Hi - if you select Basic then the rule will return true even if the user has a greater level of access.

    Hope this helps,

    Scott

  • KG_CRM Profile Picture
    on at

    Thanks Mahendar and thanks Scott for your help.

  • Mahendar Pal Profile Picture
    45,095 on at

    Yes, Scott is correct, I was wrong in my previous reply, if you user will have higher access level it will return true in basic as well.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans