Using SPBasePermissions to Manage Content and Rights in SharePoint
The SPBasePermissions Enumeration is used in many components of the SharePoint object model, which can be used to obtain, set or check permissions for users and content, site, lists / libraries, the User Interface and much more.
When working programmatically with the SharePoint Object model, it is easy to determine which rights a user must have to access content or complete various actions, as well as set permissions.
The following article provides a list of objects with properties and methods that return SPBasePermissions for objects and users, as well as inforamtion about uses that don’t require the use of code such as the SPSecurityTrimmedControl class and customisations to the User Interface.
SPBasePermissions Usage With (Programmatic) and Without Code
Some of the programmatic uses provided in the article include:
- Get or set the Base Permissions for a Role Definition in a Web
- Get the current or specified user’s effective SPBasePermissions on an object (SPWeb, SPList, SPListItem, etc.)
- Check if a user has the specified permission(s)
Getting and setting permissions for:
- Layout Page Base
- Trimmed Content on a Page
- SPPermission object
- ConsoleAction object or ConsoleNode
- developer dashboard
- a web application
- Mobile Page
- Toolbar Menu Button
- The Ribbon
- Custom UI Actions / Links
See the full article for more uses of SPBasePermissions .