Monday, December 22, 2008

Using SPSecurityTrimmedControl to show a section depending upon user permission

Scenario:
If you are writing a master page or a content page, you might have a requirement to display a section depending upon the user permissions.

Solution:
SPSecurityTrimmedControl is your best friend.

Code:

<SharePoint:SPSecurityTrimmedControl PermissionsString="AddAndCustomizePages, ManageLists" runat="server">
You can see me because you have Manage List and Customize Pages permission
</SharePoint:SPSecurityTrimmedControl>
Article:
Other posssible permission strings

0 comments: