How to hide elements from anonymous users in SharePoint 2013

Sometimes we need to hide some elements of the page from anonymous users.

To achieve that you just need to insert this:

<SharePoint:SPSecurityTrimmedControl runat="server" AuthenticationRestrictions="AuthenticatedUsersOnly" EmitDiv="true">
   HTML to hide from anonymous users
</SharePoint:SPSecurityTrimmedControl>

Note: The PermissionsString attribute defines the permissions the user must have in order to view the content. See SPBasePermissions enumeration for a listing of possible values.

Have more questions? Submit a request

Comments

Got a question?

If you can't find the answer to your question, you can contact us.
We are here and happy to help.

Powered by Zendesk