How to hide Site Actions and View All Site Content

Overview
Many of you would probably be in the situation when you realise the “Site Actions” and “View All Site Contents” appears to any users. No matter how you move the users around, they can still see them. Further to my previous post, the below is the detailed steps to help you in modifying the master pages.

Assumptions
I assume you already know where to find the master page, and to open it using SharePoint designer. Otherwise, read this before going any further.

SPSecurityTrimmedControl
This SharePoint control controls when a component is being display. Wrap this tag around the components that are to be show or hide depending on user permission. Its property PermissionsString is where permission is being specified. A summary of the permission values:
List Permissions

  • ManageLists
  • CancelCheckout
  • AddListItems
  • EditListItems
  • DeleteListItems
  • ViewListItems
  • ApproveItems
  • OpenItems
  • ViewVersions
  • DeleteVersions
  • CreateAlerts
  • ViewFormPages

Site Permissions

  • ManagePermissions
  • ViewUsageData
  • ManageSubwebs
  • ManageWeb
  • AddAndCustomizePages
  • ApplyThemeAndBorder
  • ApplyStyleSheets
  • CreateGroups
  • BrowseDirectories
  • CreateSSCSite
  • ViewPages
  • EnumeratePermissions
  • BrowseUserInfo
  • ManageAlerts
  • UseRemoteAPIs
  • UseClientIntegration
  • Open
  • EditMyUserInfo

Personal Permissions

  • ManagePersonalViews
  • AddDelPrivateWebParts
  • UpdatePersonalWebParts

For multiple permissions, separate the permissions with a comma (,). For example:

<...PermissionsString="ManagedSubwebs,ManageLists"...>

For more details, go here.


Hiding Site Actions button

  1. After opened the default master page, search for the tag SharePoint:SiteActions.
  2. If not already exists, insert the line before the SharePoint:SiteActions tag:

  3. Insert the closing tag SharePoint:SPSecurityTrimmedControl after the closing tag of SharePoint:SiteActions
  4. Change the permission string using the available permissions listed above.

Hide View All Site Content link

  1. After opened the default master page, search for “~site/_layouts/viewlsts.aspx”. Normally the SharePoint:SPSecurityTrimmedControl tag is already exists before the line.
  2. If not already exists, insert the line before the DIV:

  3. Insert the closing tag SharePoint:SPSecurityTrimmedControl after the corresponding closing DIV tag.
  4. Change the permission string using the available permissions listed above.

Acknowledgments
This article is being inspired by the following posts:

Leave A Reply

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