Many times we have come across the need to set privileges using Sitemap. The SiteMap defines the areas represented in the CRM client’s main application Navigation Pane. We use the predefined privilege tags to achieve this.


Same feature is not available for entity Navigation Pane using isv.config. For implementing Role based security in Entity navigation pane, im presenting an example here.

In the example, we want to display Budget Spreadsheet link only if user has Read access to Budget Header entity.

Nav Pane

We create a new Role, say ‘Budget Read’ and give it Read rights for Budget Header entity. Next, we assign this role to all users we want to give Read access on Budget Header entity.

Check the Id of Budget Spreadsheet in Navigation pane using IE Dev toolbar. On the formload, write the following JS:

var bsheet = document.getElementById(‘navIsvBudgetSpreadsheet’);’none’;


(Save the above file as txt file to view code) 

function UserHasRole(roleName)
//get Current User Roles, oXml is an object
var oXml = GetCurrentUserRoles();
if(oXml != null)
//select the node text
var roles = oXml.selectNodes(“//BusinessEntity/q1:name”);
if(roles != null)
for( i = 0; i < roles.length; i++)
if(roles[i].text == roleName)
return true
return false

var bsheet = document.getElementById(‘navIsvBudgetSpreadsheet’);”;

Thats it! You’re ready to test your changes. Ofcourse there can be plenty of options you can exercise using similar techniques. Happy programming!


Avatar for Joe D365

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.