Top Menu

Showing posts with label Security. Show all posts
Showing posts with label Security. Show all posts

Tuesday, March 5, 2013

SharePoint 2010 - Security Trimming

I came across a requirement where I have to hide the Ribbon for the readers in SharePoint 2010.
Following is the snippit of the control to do the magic:

<Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="ManageLists">
      Your ASP.NET control goes here
</SharePoint:SPSecurityTrimmedControl>

Permission values could be following:
  • ManageLists
  • ManageWeb

Monday, November 9, 2009

Security on SharePoint Website Controls with SPSecurityTrimmedControl


I came across a requirement while building a site in SharePoint 2007 where I have to display the left menu only to administrator and Thanks to Mark Wagner for his quick and to the point post on SPSecurityTrimmedControl.

What exactly I did was:

1. Open the Default.aspx in SharePoint Designer.
2. Select the left menu and then select Create Custom Content.
3. Arranged the tags as follow:

<asp:content contentplaceholderid="PlaceHolderLeftNavBar" id="Content2" runat="server">
<sharepoint:spsecuritytrimmedcontrol permissionsstring="ManageWeb" runat="server">

All the divs and HTML for the menu goes here.

</sharepoint:spsecuritytrimmedcontrol>
</asp:content>

Now the menu will only appear for users having administrator rights.
Note: Also, you can directly implement this in Master Page for hiding View All Site Content.

Official SharePoint Documentation

I have recently contributed to the official SharePoint documentation for developement. Check it out here: https://docs.microsoft.com/en-us...