SharePoint: Hide "All Site Content" Link to Non-Admin Users

Problem:  You need to hide the "View All Site Content" Link in the Quick Launch and Site Actions Menu from all users except Admin Users

Solution:  Make a copy of the v4.master (If SharePoint 2010) or seattle.master (If SharePoint 2013) and re-name it to your liking.  Open the file and search for the following block of code:



    id="idNavLinkViewAllV4"
    runat="server"
    PermissionsString="ViewFormPages"
    NavigateUrl="~site/_layouts/viewlsts.aspx"
    ImageClass="s4-specialNavIcon"
    ImageUrl="/_layouts/images/fgimg.png"
    ImageWidth=16
    ImageHeight=16
    OffsetX=0
    OffsetY=0
    Text="<%$Resources:wss,quiklnch_allcontent_short%>"
    accesskey="<%$Resources:wss,quiklnch_allcontent_AK%>"/>

Notice the highlighted line.... To hide this from non-admin users we want to change that value to "ManageWeb". This will hide the View All Site Contents Link from the Quick Launch.Next Step: Find the following block of code:



"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="ViewFormPages"
    PermissionMode="Any" />

Now we want to do the same thing here to hide the link in the Site Actions Menu. Just replace the highlighted line with a value of "ManageWeb".

Save your new Master Page, Publish it and set is as your default master. Now the View All Site Contents Link will be hidden for anyone except for users with Admin Permissions.

Comments

Post a Comment