Hiding the Ribbon for Anonymous Users in SharePoint 2010

Have you wanted to hide the ribbon on your SharePoint 2010 site from Anonymous users, or at least part of the ribbon? There is a great article here on doing this, but for my case I had to make some slight modifications. In particular, I didn’t want to hide the entire ribbon, rather I wanted to hide the site actions menu only.
First, as a quick review, there is a great tag the SharePoint allows:


1
<<span class="purple">SharePoint:SPSecurityTrimmedControl</span> ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="ManageSubwebs" />

You can place this tag around most any block of code, and by replacing the PermissionsString value, you can dictate what permissions are required to display the block of code. Most suggestions have been to place this tag around the entire ribbon, but that was overkill for what we wanted.
Also you can edit the <SharePoint:SPRibbon> tag decloration to require certain permissions to display certain features, but that will not necessarily remove the site actions. Add a PermissionsString value to the <SharePoint:SPRibbon> tag to hide parts of the ribbon, but not all of it.
Ok, so what we did.
First we modified the

1
<sharePoint:SPRibbon>

tag as follows:


1
<<span class="purple">SharePoint:SPRibbon</span> runat="server" PlaceholderElementId="RibbonContainer" PermissionsString="EditListItems" CssFile="">

This will allow most of the ribbon to be hidden from anonymous users, but the site action menu will remain. So then hide the site action meny from anonymous users, we added the following


1
<<span class="purple">SharePoint:SPSecurityTrimmedControl</span> ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="ManageSubwebs">

around the site action tag, which looks like:

<!-- site actions -->
<span class="ms-siteactionsmenu" id="siteactiontd">
    <SharePoint:SiteActions runat="server" accesskey="<%$Resources:wss,tb_SiteActions_AK%>" id="SiteActionsMenuMain" PrefixHtml="" SuffixHtml="" MenuNotVisibleHtml="&nbsp;" >

 
Don’t forget to add the closing

1
</<span class="purple">SharePoint:SPSecurityTrimmedControl</span>>

tag after the close of the site action’s

1
</span>

.

One thought on “Hiding the Ribbon for Anonymous Users in SharePoint 2010

  1. Bharath (@radhekrsna) October 12, 2011

    Hi Eric,
    This is a very helpful post.
    I need another help that is: Ribbon must not hide for anonymous people. Ribbon must visible with sign in and Give Feedback buttons for anonymous users.
    Please guide me how to do that.
    Regards,
    BRK

Leave a Comment

Your email address will not be published. Required fields are marked *

Enter Code *

Filed Under

Related

Are you preparing to launch a new #SharePoint #intranet?

Don’t spring it on employees out of the blue. First, talk to as many of them as you can.

Planning is just phase one. For all of our tips, watch our recent webinar with @EricOverfield!

https://pixelmill.com/webinar-recap-9-takeaways-from-a-migration-to-sharepoint-online/

Are you preparing to launch a new #SharePoint intranet?

Don’t spring it on employees out of the blue. First, talk to as many of them as you can.

Planning is just phase one. For all of our tips, watch our recent webinar!

http://ow.ly/dsQM50GqPI5

It's that time again! Join #Microsoft MVP & Regional Director, @EricOverfield on Thursday, October 28th, at 11:00 AM PST as he walks through #MicrosoftViva’s current state & offerings and what they mean to your #digitalworkspace right now.

http://ow.ly/3QFK50Gnx9f

It's the final countdown! Join @EricOverfield at 11am PST to learn about common pitfalls and paths to success when moving to #SharePointOnline. You'll walk away with practical tips to use in your organization today!

http://ow.ly/fdf150GjyJT

In today's episode of the #PixelMillWebinars, you'll learn from the experience of a global organization’s path to digital teamwork victory and get to see first-hand how to successfully plan a smooth migration for your team.

Join us at 11am PST!

https://pixelmill.com/webinar-9-takeaways-from-a-global-organizations-migration-to-sharepoint-online/

Subscribe to PixelMill's
E-news

* indicates required

Let's Talk Digital
Workspaces Today

Get In Touch