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:



Above the bold section, add the following line of code:

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:



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:

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


Change the value to be whatever you set it to in the previous code segment above and save your changes.

Hope this helps!

Short URL: http://eoszak.me/XG18XY

Eric

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 35 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a Sr .Net/SharePoint Developer for General Motors, and also as a consultant.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

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!

Leave a Reply