Tuesday, August 31, 2010

Hide SharePoint 2010 Ribbon Control from public users

There are some posts about how to hide SharePoint 2010 Ribbon from users with least permissions. One example is here. But it trims the ribbon from the page, which could cause some issues. Most known is a scroll bar disappearing.
BTW: there is a perfect article about SharePoint 2010 Ribbon Control from its designer.


There is the way how to real hide it depending of current user permissions (owner permission in this example). Just add this to the head section on master page.

<style type="text/css">
div#s4-ribbonrow {
display:none;
}
</style>

<Sharepoint:SPSecurityTrimmedControl runat="server"
Permissions="AddAndCustomizePages">
<style type="text/css">
div#s4-ribbonrow {
display:block;
}
</style>
</Sharepoint:SPSecurityTrimmedControl>

1 comment:

  1. this breaks the site navigation for pages that have any control that tries to load the ribbon. i'm not sure this is a viable option without the possibility of lost functionality.
    ie: user accessing a read-only document library, clicks on check box for an item. navigation is gone.

    ReplyDelete