Hiding a link in the sitemap based on security role in crm 2011 using javascript

2.7k views Asked by At

Is there any way to hide a link in the SiteMap in CRM 2011 using javascript? The link is not that of an entity. It's basically an injected link which opens up a custom HTML page in the dashboard. Is there any way I can probably wire up a javascript function so that the link can be made visible/hidden by invoking that javascript function?

If that is not possible, could there possibly be a workaround for this?

Thanks.

2

There are 2 answers

0
Peter Majeed On

You can restrict users' access to a SubArea by using the Privilege element. If a user doesn't have the right privilege, that SubArea won't show, though this is obviously not something that you trigger programmatically on load.

<SubArea Id="search" Icon="" Url="http://www.dropbox.com">
  <Titles>
    <Title LCID="1033" Title="Dropbox Search" />
  </Titles>
  <Descriptions>
    <Description LCID="1033" Description="Dropbox searching." />
  </Descriptions>
  <Privilege Entity="product" Privilege="Create" />
</SubArea>
0
BenPatterson1 On

The sitemap XML documentation doesn't have anything to disable a link based on javascript.

I've ask a somewhat similar question here, with a less than ideal conclusion.. The sitemap is pretty locked down.

If the privilege solution Peter points out is not going to be compatible with your situation, I suppose your HTML web resource will have to handle the blocking in the page's onload event.