1

Ive been playing around with some sharepoint rebranding. Ive managed to hide the suitebar for users without manageweb permissions and rebrand the global nav using a custom master page. There seems to be a problem with the scroll bars though. If i am logged in with admin rights the scroll bar is visible, however if am testing a user with read only access the scroll bars arent present and i cant scroll down to view my simple test content. How do i get the scroll bars to appear if the user has only read permissions. Ive included a couple of screen shots to show

  1. logged in with admin rights. Scroll bar present

enter image description here

  1. logged in with read rights. No scroll bar present

enter image description here

1

ok so i played around with this for a while and came up with a viable solution based on a post i found here.

Heres the text

During a migration from SharePoint 2007 to SharePoint 2010 we saw the perfect moment to update the current branding of the intranet site. So lets start updating the masterpages en css files.

One of the main points was hiding the ribbon for the users that don’t have editlistitem permissions. This was accomplished by using the SPSecurityTrimmedControl. But if you use the SPSecurityTrimmedControl around all the divs that are using the ribbon, the page will not render succeful and the scrollbar will disappear.

<SharePoint:SPSecurityTrimmedControl ID="TrimmedControl" runat="server" PermissionsString="EditListItems">
<div id="s4-ribbonrow" style="display:none">
<div id="s4-ribboncont">
   <SharePoint:SPRibbon>

   </Sharepoint:SRibbon>
</div>
</div>
</SharePoint:SPSecurityTrimmedControl>

The solution for this problem is using the SPSecurityTrimmedControl inside the divs that are using the ribbon

<div id="s4-ribbonrow" style="display:none">
<div id="s4-ribboncont">
 <SharePoint:SPSecurityTrimmedControl ID="TrimmedControl" runat="server" PermissionsString="EditListItems">
  <SharePoint:SPRibbon>

  </Sharepoint:SRibbon>
 </SharePoint:SPSecurityTrimmedControl>
</div>
</div>

For hiding the ribbon correctly also include a jquery library and add the following jquery to the masterpage

<SharePoint:SPSecurityTrimmedControl ID="st1" runat="server" PermissionsString="EditListItems">
<script type="text/javascript">
$(document).ready(function()
{
$('#s4-ribbonrow').show();
});
</script>
</SharePoint:SPSecurityTrimmedControl>

Be carefull, the permissionstring for the second SPSecurityTrimmedControl is the same as the first SPSecurityTrimmedControl that is arround the Ribbon.

Also add css style to the “s4-ribbonrow” div and set the display to none, the jquery line will show the div if needed based on the SPSecurityTrimmedControl

  • 1
    Paste the viable solution from post in your answer, as link-only answers tend to die if the link is broken.. :) – Arsalan Adam Khatri Sep 8 '14 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.