Tuesday, July 22, 2008 3:26 PM
by
Mike
Hiding MOSS functionality in the master page or a page layout
Recently I was asked how we could show and hide things based on user permission, without writing a custom MOSS feature with c# code. There are a couple ways to do this and rather than me spending type typing up a how to or show examples, I've looked up a couple examples other people have provided on the net:
SPSecurityTrimmedControl - specify what permissions are needed to show the items wrapped in this control. The blog post below explains this pretty well and shows you all the available permissions you can use. Notice that at the bottom of the post, the author included a code example.
An example of using this would be to hide the Site Actions menu for everyone who does not have permission to AddAndCustomizePages and ManageLists... in other words, do not show the site actions menu for users who are visitors or contributors.
Referenced blog post - http://zac.provoke.co.nz/archive/2007/05/31/spsecuritytrimmedcontrol-possible-values-for-permissionsstring.aspx
MenuItem PermissionsString - specify what permissions are needed to show the current menu item. The blog post below documents this pretty well and shows a very good example for hiding 'edit page' from the site actions menu using this method.
Referenced Blog Post - http://www.sharepointblogs.com/holliday/archive/2008/01/14/hide-edit-page-in-site-actions-menu.aspx