List Aggregator App (SPFx)

SPSecurityTrimmedControl in SharePoint 2013/2010

SPSecurityTrimmedControl in SharePoint 2013

This SharePoint 2013 tutorial explains, SPSecurityTrimmedControl in SharePoint 2013/2010.

This is a very beautiful thing that SharePoint 2010 provides, probably it was there in MOSS 2007 also known as spsecuritytrimmedcontrol. SPSecurityTrimmedControl in SharePoint is used to conditionally renders the contents of the control to the current user only if the current user has permissions defined in the PermissionString. The same way also spsecuritytrimmedcontrol SharePoint 2013 works.

SharePoint deveopment training course

SPSecurityTrimmedControl in SharePoint 2013/2010

SPSecurityTrimmedControl helps to do security trimming of the child controls inside it. You just need to put the controls inside SPSecurityTrimmedControl and then it will display or hide the controls based on the permission specified in SharePoint 2010/2013.

By using SPSecurityTrimmedControl you can also hide the Site Actions menu, View All Site Content menu from Anonymous Users.

Here you need to put your control inside the tag like

<Sharepoint:SPSecurityTrimmedControl> </SharePoint:SPSecurityTrimmedControl>
<Sharepoint:SPSecurityTrimmedControl runat=”server” PermissionsString=”ManageLists”>
<PublishingSiteAction:SiteActionMenu runat=”server” />
</SharePoint:SPSecurityTrimmedControl>

Here the SiteActionMenu will appear to those users who belongs to ManageLists permissions.

The permissionsString attribute defines the permissions the user must have in order to view the content. So PermissionsString is very much important here. There are lots of permission available like below, and also you can check in this msdn url.

AddAndCustomizePages
AddDelPrivateWebParts
AddListItems
ApplyStyleSheets
ApplyThemeAndBorder
ApproveItems
BrowseDirectories
BrowseUserInfo
CancelCheckout
CreateAlerts
CreateGroups
CreateSSCSite
DeleteListItems
DeleteVersions
EditListItems
EditMyUserInfo
EmptyMask
EnumeratePermissions
FullMask
ManageAlerts
ManageLists
ManagePermissions
ManagePersonalViews
ManageSubwebs
ManageWeb
Open
OpenItems
UpdatePersonalWebParts
UseClientIntegration
UseRemoteAPIs
ViewFormPages
ViewListItems
ViewPages
ViewUsageData
ViewVersions

If you want to give multiple permissions to the PermissionString then you can give a comma separated like below:

<SharePoint:SPSecurityTrimmedControl PermissionsString=”AddAndCustomizePages, ManageLists” runat=”server”>
<PublishingSiteAction:SiteActionMenu runat=”server” />
</SharePoint:SPSecurityTrimmedControl>

You may like following SharePoint tutorials:

Hope this article will be helpful to know about spsecuritytrimmedcontrol in SharePoint 2013/2010.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →