Tuesday, November 9, 2010

Hiding ribbon except for admin

Client wanted to hide the ribbon from everyone except admin.

1) Open your SharePoint master page
2) Add the following style in head section

<style type="text/css">
#s4-ribbonrow { display : none; }
3) Now find the start of the "s4-ribbonrow" tag and add following block before this:

<Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="AddAndCustomizePages">
<style type="text/css">
#s4-ribbonrow { display : block; }
4) Save the new master page and publish it.

Similar article ( Thanks nilesh ) Hide ribbon , Hide/Show Codeplex project


Chaitu November 17, 2010 at 9:51 AM  

Nice trick. You saved my day :)

In my case, I needed users to be able to have access to the Welcome control and therefore moved it out of the ribbonRow.

Anonymous,  February 12, 2013 at 1:30 PM  

Great, Thanks!