Tuesday, March 27, 2012

CRM 2011 Privileges in Sitemap Hiding

Hiding Settings and Resources from sitemap for all the users except Administrator, System Customizer.
We could not edit sitemap directly on security privileges for this purpose we use a small trick.
We will follow these step to accomplish our task.
1) Create a new entity
2) Give read access to administrator and system customizer role
3) Download SiteMap.
4) Edit SiteMap add this line
<Privilege Entity="account" Privilege="Read" /> I will explain this below.
5) Upload again The Site map.

Let Start.
1) Create a new entity and name it RoleHideSettingsResource. (new_RoleHideSettingsResource).
2) Give read access to Administrator and customizor (Check any other user dont have read privilege to this entity.
by Default only Administrator and customizor has the read privilege.
3) Download the site map using this tool sitemapeditor. Its very easy to use

4) Click on Save SiteMap (sitemap.xml)
5) Open the SiteMap in any editor Tool ( I am using visual web developer)


 <Area Id="Settings" ResourceId="Area_Settings" ShowGroups="true" Icon="/_imgs/settings_24x24.gif" DescriptionResourceId="Settings_Area_Description">

7) Under every <SubArea> add this line
 <Privilege Entity="new_RoleHideSettingsResource" Privilege="Read" />

8) Your first Area looks like this
<Group Id="Business_Setting" ResourceId="Menu_Label_Business" DescriptionResourceId="Menu_Label_Business">
      <SubArea Id="nav_businessmanagement" ResourceId="Homepage_BusinessManagement" DescriptionResourceId="BizManagement_SubArea_Description" Icon="/_imgs/ico_18_busmanagement.gif" Url="/tools/business/business.aspx" AvailableOffline="false">
        <Privilege Entity="new_RoleHideSettingsResource" Privilege="Read" />
      <SubArea Id="nav_template" ResourceId="Homepage_Template" DescriptionResourceId="Template_SubArea_Description" Icon="/_imgs/ico_18_templates.gif" Url="/tools/templates/templates.aspx" AvailableOffline="false">
        <Privilege Entity="new_RoleHideSettingsResource" Privilege="Read" />
      <SubArea Id="nav_productcatalog" ResourceId="Homepage_ProductCatalog" DescriptionResourceId="ProductCatalog_SubArea_Description" Icon="/_imgs/ico_18_productcatalog.gif" Url="/tools/productcatalog/productcatalog.aspx" AvailableOffline="false">
        <Privilege Entity="product" Privilege="Read" />
        <Privilege Entity="new_RoleHideSettingsResource" Privilege="Read" />

9) Save the file
10) Click on open siteMap
 11) And Than Update SiteMap

Now only Administrator and system customizor could see Settings and resource center tab.
Thanks and if you need some more help please comment here.