Thursday, 23 August 2012

How to Hide Site Actions and View All Site Content For Certain User

Hiding Site Actions:
Open your master page in any editor like Visual studio (recommended) or notepad.
Find “SharePoint:SiteActions”.
Now add SharePoint:SPSecurityTrimmedControl control just before the SharePoint:SiteActions control
Check the screen shot.



Here is the text to add
<SharePoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="ManageSubwebs">

<<SharePoint:SiteActions control>>

</SharePoint:SPSecurityTrimmedControl>

Now here is the description what we had done.

SPSecurityTrimmedControl as the name suggest, the control check the SharePoint permission and if user is permitted (if the user have permission) then it will access the content inside this control.
And if the user don’t have a permission then the content inside this control will not been accessed.

PermissionsString attribute define which set of permission can access the control.


Hiding View All Site Content:

Find “~site/_layouts/viewlsts.aspx” in the master page.

You will find Sharepoint:SPSecurityTrimmedControl is already there but the
PermissionsString attribute is set as “ViewFormPages”.

Which means that if a person have view rights in the form pages then that person can see this link.

Hiding Ribbon Control:


No comments:

Post a Comment