Click here to Skip to main content
15,880,725 members
Articles / Productivity Apps and Services / Sharepoint / SharePoint 2013
Tip/Trick

Hide SharePoint Top Ribbon for all Users Except Site Collection Administrators

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
6 Jul 2016CPOL 12.2K   1   1
How to hide Sharepoint designer ribbon for all users except site collection administrator

Introduction

This tip will help you to hide the top ribbon on the Sharepoint site collection.

  1. Navigate SharePoint Site and click Sit Settings from Setting Menu
  2. Click Master Pages and Page Layouts link in Web Desginer Galleries section
  3. Download seattle.html page
  4. Make the following changes in the masterpage code

Add the below code before s4-workspce div " <div id="s4-workspace" class="ms-core-overlay">"

The JavaScript code document.getElementById("ms-designer-ribbon").style.display = "block";
will be executed only if the logged on user is site collection administrator, because we set the permission string value as "FullMask". If you want to hide the menu only for anonymous user, then change the PermissionString as AnonymousUsersOnly. The permission string possible values are given below:

Image 1

JavaScript
<!--MS:<Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2"
   runat="server" PermissionsString="FullMask">-->
           <script type="text/javascript">//<![CDATA[

       document.getElementById("ms-designer-ribbon").style.display = "block";

           //]]>
           </script>
       <!--ME:</Sharepoint:SPSecurityTrimmedControl>-->

History

  • 5th July, 2016 - Initial version created

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
India India
I am Senthil Gopal, a SharePoint Lead based out of Chennai, India.
I have around 9+ years of experience in Microsoft technologies such as C#,Asp.net, SharePoint 2010 and 2013.
This is a Social Group

4 members

Comments and Discussions

 
QuestionHow to hide top navigation for basic search centre Pin
Member 128930857-Dec-16 18:47
Member 128930857-Dec-16 18:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.