"Knowledge has to be improved, challenged, and increased constantly, or it vanishes."

Hide Ribbon in SharePoint 2013 Publishing site

 

In SharePoint all authenticated users will see the ribbon control in the top of the page.

clip_image002[1]

For unauthenticated users, the ribbon control will be hidden and will display the sign in link. If you want to hide the sign-in link, I have outlined the steps in the below article.

Hide Sign in Link from SharePoint publishing site

In publishing sites, you may enable various types of users to be authenticated to your website. You may enable forms authentication in SharePoint to authenticate the users residing in your database. For e.g. in a typical shopping cart web, you will have the buyer login to purchase the product. In such cases, you need to hide the ribbon controls from those users.

Open your master page, and search for SID:02, you will find the Ribbon snippet as follows.

clip_image004[1]

The SID:02 will be replaced with the ribbon control when the HTML master page is converted to SharePoint master page. So you need to hide this control from those users who doesn’t have permission to modify the website. There is a permission level in SharePoint “ManageWeb”. This represents users with the permission to modify the site, only such users need to see the ribbon. You just need to wrap your ribbon snippet inside a SPSecurityTrimmedControl with permissions attribute set to the manage web.

Anything placed inside the SPSecurityTrimmedControl will be displayed only to those users specified by the Permissions attribute.

<!--MS:<SharePoint:SPSecurityTrimmedControl runat="server" Permissions="ManageWeb">—>

…………………………………………………………………………

<!--ME:</SharePoint:SPSecurityTrimmedControl>-->

You can find more information about the security levels available in SharePoint 2013 from the below link.

https://technet.microsoft.com/en-us/library/cc721640.aspx

The modified HTML master page looks like below.

clip_image006[1]

Let me try to login to my site with a user

clip_image008[1]

You will see the ribbon is not visible to the user with name “buyer” which is a user from forms authentication. When the users with ManageWeb permission level, they will be able to see the ribbon control.

7 Comments

Add a Comment

As it will appear on the website

Not displayed

Your website