0

Ribbon image

I'm trying to make the Ribbon such that only authorized admin (permissions set in the site permissions feature) can use the Ribbon controls (Browse, Edit, Page). How do I prevent unauthorized users from using the ribbon? I'm currently using SharePoint 2013. Is the solution to this issue under site settings? Or maybe I have to use javascript? Please help me thanks.

0

You could use SPSecurityTrimmedControl for this.

<!—MS:<SharePoint:SpSecurityTrimmedControl runat="server" permission="permission needed to access">—>
the content you want to hide
<!—MS:</SharePoint:SpSecurityTrimmedControl>—>

Some sample threads for your reference.

https://blogs.technet.microsoft.com/vinitt/2013/04/27/hide-ribbon-for-anonymous-users-sharepoint-2013/

https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-add-a-security-trim-snippet-in-sharepoint

https://social.technet.microsoft.com/Forums/en-US/cae6509f-7835-4f7b-bdcd-ee445c4dfbf9/disable-master-page-ribbon-for-certain-sp-groups?forum=sharepointgeneralprevious

  • This solution works to a certain extent. It does disable the ribbon but causes my UI's scrollbar to be gone, and I can't scroll down the page. Is there any alternatives to display:block? I tried display:none it doesn't work either. – Denise Dec 20 '17 at 8:02
  • Without the css, the scrollbar is still non-existent – Denise Dec 20 '17 at 8:25
0

Is the solution to this issue under site settings?

Unfortunately, No.

Or maybe I have to use javascript?

No need to use JS, just follow the below steps to hide the ribbon from the non-admin users

Steps

  • Open SharePoint Designer.
  • Open your site > From left side Click on Master Pages.
  • In SharePoint 2013 There are two related files for Master Page (HTML, Master)
  • Right Click on your custom Master Page with HTML extension > Check Out.

  • Again, Right Click on Master Page with HTML extension > Edit File Advanced Mode.

  • Search for DIV with ID “ms-designer-ribbon“

  • Surround it with this tag SharePoint:SPSecurityTrimmedControl to looks the following

<!--MS:<SharePoint:SPSecurityTrimmedControl runat="server"  
PermissionsString="FullMask">-->
< div id="ms-designer-ribbon" >
 <!--SID:02 {شريط}-->
 <!--PS:  -->


<!--PE:  -->
</div>
<!--ME:</SharePoint:SPSecurityTrimmedControl>-->
  • In PermissionsString attribute, you can add any permission type based on your requirement from the following:
    • FullMask.
    • EmptyMask.
    • ManagePermissions.
    • ManageSubwebs.
    • ManageWeb.
    • AddAndCustomizePages.
    • BrowseDirectories.
    • ViewPages.
    • EnumeratePermissions.
    • ManageAlerts.
  • Save the changes > Check In > Publish Master Page as a major version.

Check the detail steps at How to hide the SharePoint 2013 ribbon

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.