Looking for PowerObjects? Don’t worry, you’re in the right place! We’ve been part of HCL for several years, and we’ve now taken the final step in our acquisition journey: moving our website to the HCL domain. Nothing else is changing – we are still fanatically focused on Microsoft Business Applications!

PowerObjects Blog 

for Microsoft Business Applications


Solving Security Headaches: Display Rules Based on Security Roles

Post Author: Joe D365 |

Some organizations need to allow certain users to access buttons on the Ribbon or Command Bar, while allowing others to utilize them based on the users' security privileges. If you think this cannot be done, good news! It can! There are a few different ways to accomplish this functionality, and in today's blog, we will show you how to solve your security role headaches. Let's dive in!

The steps outlined below require no coding and can be easily implemented utilizing the Ribbon Workbench and out-of-the-box security roles. To accomplish this, we created a custom entity (po_Security) to manage the display rules, however, this is not required as the exiting entities and privileges can be used. We created the new entity to ensure that no existing entity privileges were going to be effected, but the same principles will apply regardless if you chose to create a new entity or not.

1. First, start by downloading and installing the Ribbon Workbench.

2. In CRM, create a new solution that will contain only the entities you wish to update the button display rules for.

3. Next, launch the Ribbon Workbench from the Solutions section in Settings.

Security Roles in CRM

4. In the Ribbon Workbench, select a solution to open. We'll select the solution that we created for the purposes of our button display rule edits.

Security Roles in CRM

5. When the solution loads in the Ribbon Workbench, select the entity to start with.

Security Roles in CRM

6. In this example, we will be removing the ability for certain users to create and add existing Leads from a sub grid on the Account entity as well as the ability to delete or remove Lead records from the grid. Select the first button to create and apply a display rule to. Right click on button and select Customize Command.

Security Roles in CRM

7. Navigate to Commands in the Solution Elements tab.

Security Roles in CRM

8. Right click on the Command and click Edit Display Rules (or select the lookup on the Display Rules field as shown on the right).

Security Roles in CRM

9. Select +Add New in the display rules viewer.

Security Roles in CRM

10. Select Add Step.

Security Roles in CRM

11. Select Entity Privilege Rule and then click OK.

Security Roles in CRM

12. Create the New Display Rule:

  • Make sure to update the ID (the name of the rule) as the default name is generic and difficult to keep track of if you have multiple rules. Use a name that will help differentiate the purpose of the rule and allow you to identify it easily.
  • AppliesTo – choses selected entity. This refers to the value input into the EntityName field.
  • EntityName – enter the schema name of the entity.
  • PrivilegeDepth – choose the appropriate level of the privilege you are using to control the display functionality of the button. In this example, we are using the Global privilege level for the created permission of the custom po_security entity created previously.
  • PrivilegeType – select the privilege type (create).

Security Roles in CRM

13. Next, select OK and the Display Rule will be added to the Command. Select OK again on the Display Rules viewer to enable the rule.

14. To apply the same rule to additional buttons, select the next button you wish to add the Display Rule to. Right click and select Customize Command.

Security Roles in CRM

15. Navigate to the Command section and select the command to customize. Right click and choose Edit Display Rules.

Security Roles in CRM

16. Select the previously created rule and click Add > to button commands. Then click OK.

Security Roles in CRM

17. Repeat these steps for all required buttons. In our example, notice all of the buttons required to be hidden in order to achieve the desired functionality.

Security Roles in CRM

18. Now that the Display Rules are applied to the necessary buttons, notice that we no longer have the ability to add a new Lead from the sub grid.

Security Roles in CRM

With a basic understanding of how Display Rules work and how to utilize out-of-the-box security roles, you can provide more flexibility to how users perform specific functions in CRM.

Want to learn more about Dynamics CRM? Did you know that we have an entire library of Webinars on Demand? Watch and learn more about CRM anywhere, anytime! Make sure you sign up for our event notifications as well, so you can be notified about any new and upcoming webinars!

Happy CRM'ing!

Joe CRM
By Joe D365
Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.

2 comments on “Solving Security Headaches: Display Rules Based on Security Roles”

  1. I'm not sure which part of the post deals with the security role. How do I control the visibility of the button for a particular security role? Say admin, regular user, sales rep, developer and so.

  2. Hi Joe,
    I have a custom ribbon button on HomePageGrid and I want that button to be visible only to a specific security role say CSR Admin.
    How will I achieve it ? This is not working in my case.

PowerObjects Recommends