"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.

9 Comments

  • Can you elaborate more on ManageWeb. How to set and use this.

  • You can get more information about the permission levels from the below url

    https://msdn.microsoft.com/EN-US/library/office/microsoft.sharepoint.spbasepermissions.aspx

  • Shall I create ManageWeb group ?

  • No, it is there. You just use that in the HTML master page as mentioned above

  • cương cứng lên về cơ bản là một hiện tượng động lực học thuyết dịch

  • chung toi cung cap dich vu cho thue may photocopy gia re

  • Đứng bên bờ vực thẳm, công ty máy photocopy Hải Minh đã và đang vực lại những từ khoá về ngành máy photocopy sau một thời gian dài tụt dốc. Chúng tôi luôn nỗ lực cho người dùng có những dòng sản phẩm máy photocopy tốt nhất và có giá rẻ nhất trên thị trường

  • Good day,
    Thanks for the topic. It works fine, but if user doesn't see ribbon, he can't see page scroll bar too...
    How can I display scroll bar?

  • CÔNG TY TNHH QUẢNG CÁO NỘI THẤT QUỐC ĐĂNG chuyên thiết kế thi công các loại biển quảng cáo trên mọi chất liệu. Phương châm hoạt đông : Uy tin - Chất lượng - Giá cả tốt nhất. Công ty TNHH Quảng Cáo Nội Thất Quốc Đăng
    Hotline/Zalo: 0988425698
    Trụ sở chính: Số 18 Tam Trinh - Hoàng Mai - Hà Nội (khu cơ khí Trần Hưng Đạo)
    Xưởng sản xuất số 1: Số 6 ngách 85/30 Lĩnh Nam – Hoàng Mai – Hà Nội
    Xưởng sản xuất số 2: Số 18 Tam Trinh – Hoàng Mai – Hà Nội
    Email: qcled89@gmail.com
    Website: https://quangcaoktd.com

Add a Comment

As it will appear on the website

Not displayed

Your website