Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Hide a Ribbon Based on Security Roles - CRM 2016 Online

Posted on by 3,702

Hi,

I want to hide and show a ribbon based on security roles, could you please guide me.

If the User Contains and Role "A" the Ribbon should be visible if doesn't it should  be hidden 

*This post is locked for comments

  • Prajwal Bhetwal Profile Picture
    Prajwal Bhetwal 65 on at
    RE: Hide a Ribbon Based on Security Roles - CRM 2016 Online

    hi razdynamics the link is not accessible for some reason

  • Verified answer
    Kishor Kumar Profile Picture
    Kishor Kumar 3,702 on at
    RE: Hide a Ribbon Based on Security Roles - CRM 2016 Online

    Hi Guys, thanks for all you response! I have solved the issue as the isNaan function was not used when I want to run the hide the custom ribbon button, in the Home Page Grid.

  • Suggested answer
    Maneesha Profile Picture
    Maneesha 5,889 on at
    RE: Hide a Ribbon Based on Security Roles - CRM 2016 Online

    Kishor Kumar U,

    check "Raz Dynamics" link its works fine , i already go through it  

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Hide a Ribbon Based on Security Roles - CRM 2016 Online

    Share your screenshots of Entity Privilege Rule, Custom Entity name and Security Role privilige of the new custom entity that you don't want to show the button.

    I think you need to use Enable Rule JavaScript Rule to write your JavaScript instead of on load of form.

    You can't use Javascript function in Display Rule.

    448363.Capture.PNG

  • Kishor Kumar Profile Picture
    Kishor Kumar 3,702 on at
    RE: Hide a Ribbon Based on Security Roles - CRM 2016 Online

    Hi Alagu,

    The Custom Button is available in the from and Home Grid as already some commands and custom role written, now I want to hide the button  based on the security roles of the User, so I have created an Entity Privilege Rule with an Custom Entity and assigned the Global Read Permission to the Entity Privilege Rule but still its not working. So then I have created an js on  load get the User role and have written true/false to the custom rule and still not its not hiding.

    Have also checked the Custom javascript already written in the button, they have done with an one Role and also tried adding the new roles to Custom filter of Odata still no response of hiding the Button.

  • Suggested answer
    Alagunellaikumar Profile Picture
    Alagunellaikumar 6,210 on at
    RE: Hide a Ribbon Based on Security Roles - CRM 2016 Online

    Hi

    Could you please share it, how could you do it?

    Step:1  select the button and in the right side pane properties window check the what command is using

    Step:2 open that command and in the enable rule, add custom rule

    www.inogic.com/.../hide-add-button-on-a-subgrid-by-applying-custom-javascript-rule

  • Kishor Kumar Profile Picture
    Kishor Kumar 3,702 on at
    RE: Hide a Ribbon Based on Security Roles - CRM 2016 Online

    Hi Alagu,

    I have tried with Javascript also and its not working

  • Verified answer
    Alagunellaikumar Profile Picture
    Alagunellaikumar 6,210 on at
    RE: Hide a Ribbon Based on Security Roles - CRM 2016 Online

    Hi

    If your button  has  disabled rule you can even one add one more in that list

    ribbonworkbench.uservoice.com/.../121427-enable-disable-a-ribbon-button-dynamically-based-o

  • Kishor Kumar Profile Picture
    Kishor Kumar 3,702 on at
    RE: Hide a Ribbon Based on Security Roles - CRM 2016 Online

    Hi Raz,

    Thanks for your reply, I have followed your steps, the issue here is the custom button already have some display rules built inside so when I click the customize button its already got disabled, how to proceed with it I want disable that button based on security role Raz

  • Suggested answer
    razdynamics Profile Picture
    razdynamics 17,304 User Group Leader on at
    RE: Hide a Ribbon Based on Security Roles - CRM 2016 Online

    Hi Kishor, I have written a blog post for you here with all the steps, basically you need to create a custom entity for each group of people you want to display the button to and use the custom EntityPrivelidge Rule for its security role in the Ribbon, you can find the details steps in my blog;

    www.crmconsultants.co.uk/hiding-command-bar-buttons-in-dynamics-crm-using-custom-security-role-privileges

    Best Wishes, Raz

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans