Hide Ribbon from Users with Read Permissions SharePoint 2010

Hide Ribbon from Users with Read Permissions in SharePoint 2010 using SPSecurityTrimmedControl.
 
Open v4.master page in SharePoint Designer.

Check out the master page and search for <div class="s4-title s4-lp"> and replace this with <div class="s4-title s4-lp" id="HeaderNavID" style="display:none">

We have given one id property which is id="HeaderNavID" and one style property which is style="display:none"

Now go to </div> tag of the above div <div class="s4-title s4-lp" id="HeaderNavID" style="display:none"> and place the below code

<Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="AddAndCustomizePages">

  <script type="text/javascript">

  document.getElementById("HeaderNavID").style.display = "block";

  </script>

   </Sharepoint:SPSecurityTrimmedControl>


0 comments:

Post a Comment

Popular Posts