locked
Hide Area base on user role RRS feed

  • Question

  • Hi,

    I want to hide let say "Sales,Marketing,Settings,Resource Center" if the user login using "Customer Service Representative" role.
    Maybe I can use "Site Map Editor" from
    http://www.microsoft.com/downloads/details.aspx?FamilyID=634508DC-1762-40D6-B745-B3BDE05D7012&displaylang=en
    But "Site Map Editor" will affect all user, I mean if I hide Sales, all user won't see Sales anymore.
    How do I hide Area (
    "Sales,Marketing,Settings,Resource Center") base on Security Role?

    thanks
    Wednesday, June 18, 2008 9:28 AM

Answers

  • You can use the 'Privilege' attribute to hide subareas (like quotes) but there's no way to hide entire areas based on privileges or roles. 

    Wednesday, June 18, 2008 3:57 PM
    Moderator
  • I know this is late, but for others reviewing this post:

    If your users do not have read access to any of the sub-areas included in the area - the area will not display.
    So the solution is to adjust your security roles. The rest will happen automatically.

    You can also use the privilege element on the subareas as Matt suggested for another level of control.

    You could create a custom entity called 'sales areas' and grant all your Sales people the privilege to create new sales area entities (but don't display this entity in the applicaiton any where) Then adjust all the sales related subareas in the sitemap to require the privilege to create this custom entity. Those users without this privliege will not be able to see these areas.

    The javascript that Imran is referring to is for the navbaritems for a form. This is set using ISV.config, so it is a different thing altogether.
    Thursday, April 2, 2009 4:57 PM

All replies

  • You can use the 'Privilege' attribute to hide subareas (like quotes) but there's no way to hide entire areas based on privileges or roles. 

    Wednesday, June 18, 2008 3:57 PM
    Moderator
  • Need to hide navbar items and control user interaction a bit better?

    Here is a java script that will hide CRM nav bar items...
    Put this in the onload of a form..

    var navBar = document.getElementById("crmNavBar");
    var optionItems=navBar.getElementsByTagName("nobr");
    for (i=0; i
    {
    if ((optionItemsIdea.innerText == "Travel") && (optionItemsIdea.parentElement) )
    optionItemsIdea.parentElement.style.display="none";

    if ((optionItemsIdea.innerText == "Intake") && (optionItemsIdea.parentElement) )
    optionItemsIdea.parentElement.style.display="none";
    if ((optionItemsIdea.innerText == "Social Services") && (optionItemsIdea.parentElement) )
    optionItemsIdea.parentElement.style.display="none";
    if ((optionItemsIdea.innerText == "Dossier") && (optionItemsIdea.parentElement) )
    optionItemsIdea.parentElement.style.display="none";

    }

    you can read my blog http://microsoftcrm3.blogspot.com where I mentioned to define code for roles and security.

     

    Regards,

    Imran

     

    Wednesday, June 18, 2008 5:03 PM
    Moderator
  • I know this is late, but for others reviewing this post:

    If your users do not have read access to any of the sub-areas included in the area - the area will not display.
    So the solution is to adjust your security roles. The rest will happen automatically.

    You can also use the privilege element on the subareas as Matt suggested for another level of control.

    You could create a custom entity called 'sales areas' and grant all your Sales people the privilege to create new sales area entities (but don't display this entity in the applicaiton any where) Then adjust all the sales related subareas in the sitemap to require the privilege to create this custom entity. Those users without this privliege will not be able to see these areas.

    The javascript that Imran is referring to is for the navbaritems for a form. This is set using ISV.config, so it is a different thing altogether.
    Thursday, April 2, 2009 4:57 PM
  • Hallo,

    for some reasons this does not work out for me.

    My sitemap entry is:
    <Area Id="SFA" ResourceId="Area_Sales" Icon="/_imgs/sales_24x24.gif" DescriptionResourceId="Sales_Description">
    <Group Id="SFA">
    <SubArea Id="nav_leads" Entity="lead" DescriptionResourceId="Lead_SubArea_Description" />
    <SubArea Id="nav_oppts" Entity="opportunity" DescriptionResourceId="Opportunity_SubArea_Description" />
    <SubArea Id="nav_accts" Entity="account" DescriptionResourceId="Account_SubArea_Description" />
    <SubArea Id="nav_conts" Entity="contact" DescriptionResourceId="Contact_SubArea_Description" />
    <SubArea Id="nav_lists" Entity="list" DescriptionResourceId="MarketingList_SubArea_Description" />
    </Group>
    <Group Id="SALES_PRIV">
    <SubArea Id="new_priv_sales" Entity="new_priv_sales">
    <Privilege Entity="new_priv_sales" Privilege="Read" />
    </SubArea>
    </Group>
    </Area>
    As you can see a new entity called "new_priv_sales" has been created. Additonally a security role with read-rights on this entity only has been established. So what im trying to achieve with the sitemap-entry above is, that only users assigned to my security role are enabled to see the "Sales" area.

    What actually happens is, that users that are not allowed to read new_priv_sales only cant see the group but the rest of the area. So the Area is not hidden although I think my structure to hide the whole area should be fine?

    Any hints are highly appreciated!! thanks
    Monday, March 8, 2010 9:44 AM