Skip to content

SPSecurityTrimmedControl and Full Control Permissions

by on November 9, 2011

In doing some recent updates to the Vinewave Staff Directory Web Part, I needed to hide a link called ‘Manage people’, which directed users to SharePoint’s built-in User Information List (the Staff Directory reads from this list).

I had to hide this link for users that did not have Full Control permissions on the site, because they were getting an access denied error when clicking on the link; the User Information list is only available to administrators.

SPSecurityTrimmedControl was the man for the job, but I couldn’t figure out what setting to use for the PermissionsString property to get it to only show content for users with Full Control permissions.

After some clever investigation on my part Googling, I eventually figured out that the property to use for this is ’FullMask’.

So, the following snippet shows how to display content only to users with Full Control permissions on the site:

<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="FullMask">
    Content goes here…
</Sharepoint:SPSecurityTrimmedControl>

Advertisement
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 67 other followers