How to hide viewall site contetn from site action menu in sharepoint 2010



In the default master page (v4.master) the Quicklaunch All Site Content link can be found around line 573 and is included in the PlaceHolderQuickLaunchBottomV4 UIVersionedContent control. Here’s what it looks like by default:

 
 
573<SharePoint:ClusteredSPLinkButton
574    id="idNavLinkViewAllV4"
575    runat="server"
576    PermissionsString="ViewFormPages"
577    NavigateUrl="~site/_layouts/viewlsts.aspx"
578    ImageClass="s4-specialNavIcon"
579    ImageUrl="/_layouts/images/fgimg.png"
580    ImageWidth=16
581    ImageHeight=16
582    OffsetX=0
583    OffsetY=0
584    Text="<%$Resources:wss,quiklnch_allcontent_short%>"
585    accesskey="<%$Resources:wss,quiklnch_allcontent_AK%>"/>

So all we have to do is change line 576 to read PermissionsString=”ManageWeb” and save.

Hiding the Site Actions Link

The Site Actions menu is just as easy to edit. The View All Site Content link can be found around line 137 inside the SiteActions FeatureMenuTemplate control. Here’s what it looks like by default:

 
 
137<SharePoint:MenuItemTemplate runat="server" id="MenuItem_ViewAllSiteContents"
138    Text="<%$Resources:wss,quiklnch_allcontent%>"
139    Description="<%$Resources:wss,siteactions_allcontentdescription%>"
140    ImageUrl="/_layouts/images/allcontent32.png"
141    MenuGroupId="300"
142    Sequence="302"
143    UseShortId="true"
144    ClientOnClickNavigateUrl="~site/_layouts/viewlsts.aspx"
145    PermissionsString="ViewFormPages"
146    PermissionMode="Any" />

Again, just change line 145 to PermissionsString=”ManageWeb” and save.
That’s it! Here’s what the same Team Site now looks like to a user with Read permission:


No comments:

Post a Comment

SPFX - HTTPClient - Curd Operations - SharePoint list.

  Create solution in the name of SpfxCrud. ISpfxCrudProps.ts export interface ISpfxCrudProps {   description : string ;     context : an...