2013-06-21

I think SPSecurityTrimmedControl was first available for SharePoint 2007. It is widely used to hide certain Elements based on user permission. In SharePoint 2010 a major improvement was introduced. The new property that made available was the AuthenticationRestriction, which gives you better control for anonymous and authenticated users. The possible values that can be specified are:

  • AllUsers – Access is available to all users.
  • AuthenticatedUsersOnly – Access is available only to authenticated users.
  • AnonymousUsersOnly – Access is available only to anonymous users.

If you like to use one of these values you simply need to define your security trimmed control like this:

<SharePoint:SpSecurityTrimmedControl runat=”server” AuthenticationResctriction="AuthenticateUsersOnly">
....
</SharePoint:SpSecurityTrimmedControl>

Now all controls inside the SPSecurityTrimmedControls will be hidden to anonymous users.

AuthenticationRestricion Enum on MSDN

Another great blogs concerning the topics for SharePoint 2010 is
Inconvenient SPSecurity TrimmedControl – Waldek Mastykarz . I tried it in SharePoint 2013 and it worked without any problem.

 

 

About the author 

Stefan Bauer