How to Hide Ribbon based on the Permission in SharePoint 2013

Hi Readers,

SharePoint introduced Ribbon in SharePoint 2010 environment. What Ribbon does for you? It provides great user experience for doing operations with SharePoint List and Libraries. It is nothing  but  a toolbar that appears across the top of each page and displays many of the most commonly-used tools, controls, and commands.

Suppose if you want to hide the whole ribbon for the section of users, or least privileged ones or Anonymous users . The below approach is simple and effective . One has to edit the Master Page with the usage of SPSecurityTrimmedControl.

Follow the below steps to hide the SharePoint ribbon control.

1.Open SharePoint master page.

2. Go to this line.

  s4-ribbonrow” class=”s4-pr s4-ribbonrowhidetitle”>

  Replace with

<div id=”s4-ribbonrow” class=”s4-pr s4-ribbonrowhidetitle” style=”display:none”>

3.Now go to end of the “s4-ribbonrow” tag and add following code

<Sharepoint:SPSecurityTrimmedControl ID=”SPSecurityTrimmedControl” runat=”server” PermissionsString=”AddAndCustomizePages”>
<script type=”text/javascript”>
document.getElementById(“s4-ribbonrow”).style.display = “block”;
</script>
Sharepoint:SPSecurityTrimmedControl>

Please check out my blog to Change Favicon Icon in SharePoint 2013.

  Happy SharePointing folks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *