Creating a Role Based Sitemap Navigation in Dynamics CRM

The ability to customise the Sitemap in Dynamics CRM to show only the menu items required for a specific business area can help focus the user on their business task and help deliver bespoke business process requirements and user experience. Security roles allow you to restrict access to entities based on privileges assigned to the users security role, Disabling read access to an entity through the security role will also remove it from the Navigation, but will not hide the entire navigational menu unless all the Entity Sub groups are hidden. I have experienced that locking the Security privileges too tightly may interfere with other integrations that require the users credentials where the Users account should be able to read a particular record via SDK message or workflow, but not through the crm interface. Therefore I recommend using the following approach of creating a custom Entity which will create a security privilege you can use to control access to the Navigation for your CRM users, and then applying the Custom Security Privelidge to the Navigation SubGroups items using the Sitemap editor.

  1. Create Custom Navigation Entities, by doing so this will create a custom security group for your custom sitemap

Create a Custom Entity for each User group you want to customise the CRM Navigation Sitemap or Ribbon for. Ie . Sales Navigation, Service Navigation, Marketing Navigation, Collections Navigation etc

https://lh3.googleusercontent.com/lnsWeA4SRYsuvIRVgOlrVfDei4EBOL4DdgTq2j_U9WSakq0uaLkc69-YpV2isswOLpUfx0z_UGEUcYTm6_d0V_c4jNPksmrYenluF9NrT7wWQCx9lm5aOiilmmcnICHdZvrLcwZflHk9rmG3cQ

 

2.  Update the Base Security for each of those groups with ‘Read’ Access to the corresponding customer Navigation entity. So the Sales Users will need ‘read; Access on the ‘Sales Navigation’ entity as shown below;

 

https://lh3.googleusercontent.com/krNg7TR-nxduAmfIDITLY_lD_N2Krhb2kEqOu-q26vMUM-U5m6W4n5MbHdGIv-4lAylAB2pzDXsfhxEJOZbFh5gEr4hlSsqvb7g9Qk4uWwK5_xNLmVsH2K_wodQ68ozfrBBpV-077RlQaklFfwhttps://lh5.googleusercontent.com/KrUZFz7fGWI5WgtxlpT4sb9OfenITovABCQYk1Ft_gqVI1gSfbgVJ6rPk1DTcTq4dDcFPSD9u-mBmYwggWTojdwnAVgM38vVKoxg0XmBRPM48PPYxsZuUkOdn2GNSg4yCq8jypt5umsu8xwDJw

3.  Update Sitemap Privileges for all the Sub Areas

The  Default CRM Sitemap consists of Main Areas of Sales, Marketing, Service and Settings as below;

 

https://lh5.googleusercontent.com/BYlmBJEd6K9dSgwj3lAvRwDM2HoqlLfHhZNIs00snuN60Z1A1VnmSWjyEQulJOS7filZMBGtktiOF91FSC298kj8g-aeVnchGI0RWu-RWZlci2HWKH9BiLhcSe325wzf72CRe5OmJnKTEigRXg

 

These main CRM Navigation areas that we are interested in hiding also consist of Sub Areas, which are the entities.

 

https://lh4.googleusercontent.com/gYbCFBOtMIqC29U6ckSUocixbfxxbJGGJSUK8dVpgBp5hqQM8GQkh8GHVMFKRHpwMGG5P2QgGvEjI-0c4Z-tSHeHCTALxNA9kGIPwg0LCIvYX6xwGbS1NzgjAbr7cBpE_wcYywalrGSMaUb1rA

 

In order to hide the Main Navigation area we will have to hide ALL of the SubArea objects. The way to do this is setting the ‘Read’ Privelidge on the Sub Area to the corresponding custom Navigation entity we created earlier.

 

<SubArea Id=”contact” Entity=”contact” Title=”Contacts”>
< Privilege Entity=”new_salesnavigation” Privilege=”Read” />
< /SubArea>
 

 

We can either export the Sitemap in the Solutions RibbonDiffXML, Or we can use the Sitemap Editor in the XRM Toolbox to this

4.  Using SiteMap Editor for security based Navigation option

The SiteMap Editor can be used to add security Privileges to the Subareas, allows us to assign the our custom navigation entity security roles we created in part 1 to be assigned to the Sub areas of the Sitemap, allowing us to grant access to the navigation menus based on users with corresponding security roles.  The Entire CRM Area will be hidden if Access to all the Sub Area objects is denied.

To Hide an Entire Menu Area of a Sitemap for a given security role, the users role must be denied access to all of its Sub Areas. So we could go about enforcing the policies for the Main CRM Areas by granting Access to all of its Sub Areas for the corresponding security groups.

So for example, to hide the entire Settings Area for a given security role, we would have to ensure all the Sub Areas under Settings do have access privileges for that group.

A) click Load Sitemap

https://lh5.googleusercontent.com/RFwlaUC5MRqfX4R1hXeCPdWs68ifUrDuWxtqG-12tMwXj-nDc7hhW2dQXEV0RAA3NvzHnfd1UCgb0o6w54uifPeRgwuBqBIRaNnx8TR2IV5LWyLeVWroGMRXNERKh9sJdYrjEu6KY0czLDVGNA

 

B) On each Sub Area, Click ‘Add Privilege’,

  • add the Navigation Entity schema name
  • tick Read
  • Click the ‘Save’ button;

https://lh3.googleusercontent.com/mp_GK4r2BqDIrRXGrARBcyV4rAMcDxHmkTnI911GtcLecN-NQ5fCeayCECYiUOyAInLoK_F_FZYm3up1fw-ktSxLjItM6WLxnRplyIcz6Op7cTSg4CIN4bg6_i1nxdqsCtDxVD1vjd1U5NJJOQ

C) Complete the steps for All the required Sub Areas

D) Click Update Sitemap

E) Now Login as a user without the ‘Sales Navigation’ Read Privilege, and they will not see the Sales Area;

 

https://lh4.googleusercontent.com/lSUKJNCNOhhf6teml7Yq9VuKM58LmQFnjRWRCZ6omxu355FNW3aWaJrfH0ZDt3J-72ZLqdI0qm4-3Y0cAWwkYR35gShhaA8aYHPhAmKW7DYViePYyOjO7wy0Kbg1IZlK1fNxlmHnu4byOn_Zuw

F) Complete the Privileges for the Other Security Groups, so that the Areas are locked down according to their corresponding custom navigation entity

In our case, there will be 4 Custom Navigation Entities

  • Sales Navigation
  • Service Navigation
  • Marketing Navigation
  • Admin Navigation ( Please Note That if you Hide the Security Sub Group Under The Admin Navigation it may prevent Billing Admins Without CRM licences From Setting Up New CRM Users)

There are Several Sitemap Editors available, such as XRMToolbox or XRM.tools, which also provide the ability to roll back to the default sitemap if required. Happy CRM’ing!



mm
Author: Raz Dynamics
Razwan is a Microsoft MVP and Dynamics 365 Community Moderator responsible for developing Microsoft Dynamics 365 and CRM integrated solutions for over a decade. Razwan is responsible for delivering Dynamics 365 User Groups & CRM Saturday Conferences. Raz has developed many free community utilities for Dynamics 365 and CRM which you can download from this blog.