Hiding View All Site Content and Recycle Bin in SharePoint 2010

Hiding View All Site Content and Recycle Bin in SharePoint 2010

I found a lot of resources online that explain many different ways of doing this, lots of comments saying it worked for them, none of which worked for me.  I even found a tutorial online that explained how to do this using a custom permission, which works, but not when the same users have to have different permissions to underlying objects in the site.  So here’s a method that works at the Master Page level, is customizable, and doesn’t affect all underlying objects whether inherited or not.

Open up the desired site in SharePoint Designer and look in your Master Pages.  Locate your desired master page (mine is v4, like most others).  Many sites say not to alter the master page itself, but to make a copy.  You can do that…..or revert to a previous version if you make a mistake.  Open the file, then click Edit File.

Look for the following element in the code:

<SharePoint:UIVersionedContent UIVersion="4" runat="server" id="PlaceHolderQuickLaunchBottomV4">
<ContentTemplate>
<ul class="s4-specialNavLinkList">

Above the bold section, add the following line of code:
<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ManagePermissions">

Change the blue PermissionsString value to whatever you want.  Multiple permissions can be separated with a comma (no spaces).  Note it should be a permission your target user(s) do not have, and has to come from this list.  Spelling and case-sensitivity is important.  Finally, add the closing tag after the SharePoint:UIVersionedContent closing tag:
</SharePoint:UIVersionedContent>
</Sharepoint:SPSecurityTrimmedControl>

Save your changes and test the results.  Those with the correct permissions should be able to see the Recycle Bin and View All Site Content elements in the quick launch area at the bottom, everyone else should not.

Note: This WILL NOT remove View All Site Content from the drop down menu under Site Actions.  To remove View All Site Content from the Site Actions drop down, in the same master page, go up towards the top and look for the following element:
<SharePoint:SPRibbonPeripheralContent
runat="server"
Location="TabRowLeft"
CssClass="ms-siteactionscontainer s4-notdlg">

Start scrolling through the MenuItemTemplate elements underneath this one, and look for the one with the id of “MenuItem_ViewAllSiteContents”.

<SharePoint:MenuItemTemplate runat="server" id="MenuItem_ViewAllSiteContents"
Text="<%$Resources:wss,quiklnch_allcontent%>"
Description="<%$Resources:wss,siteactions_allcontentdescription%>"
ImageUrl="/_layouts/images/allcontent32.png"
MenuGroupId="300"
Sequence="302"
UseShortId="true"
ClientOnClickNavigateUrl="~site/_layouts/viewlsts.aspx"
PermissionsString="ManagePermissions"
PermissionMode="Any" />

Notice the attribute I highlighted in blue? Change the value to be whatever you set it to in the previous code segment above and save your changes.

Hope this helps!

3 thoughts on “Hiding View All Site Content and Recycle Bin in SharePoint 2010

  1. This worked great for me and I could hide the “View All Site Content” link from the Siet actions menu! My next question is how do we prevent user to see the “View All Site Content” Page contents when he types url like /sites/mysite1/_layouts/viewlsts.aspx”?

    1. Sorry it took a while to reply, I just got back from vacation.

      I created a custom permission called ReadNoAllSiteContent, which is basically a copy of the existing “Read” permission, but with “View Application Pages” removed. The result is users with this permission will not only be unable to see the “All Site Content” link on the left, if they try to navigate to the URL it will tell them access denied. Keep in mind, though, this affects all other objects in that site, including lists, libraries, etc. So connected web parts, list web parts, etc will also break if they exist on a page.

      Hope this helps!

Comments are closed.

Comments are closed.