IntroductionOne of the situations we encounter when we are developing is to define who should and who should not access the pages of SharePoint by default SharePoint has default methods to achieve access the pages, but we need to have users access the pages but not the entire page, so even if heard. ScenarioUser needs to access the page content but may not update or add new content. How do you access the form pages and not save content to SharePoint? In the situation is very normal to happen and have to be very well thought out to learn in that situation is to be used, SharePoint has a control "SPSecurityTrimmedControl"to control access to controls that we consider important and should have permissions associated with SharePoint. Configure access controls for SharePoint PermissionsAdd reference the DLL, To use the control SPSecurityTrimmedControl**, you must perform the reference at the top of our page of SharePoint. Example <% @ Register TagPrefix= "SharePointWebControls"Namespace ="Microsoft.SharePoint.WebControls"Assembly ="Microsoft.SharePoint, Version = 12.0.0.0, Culture = neutral, PublicKeyToken= 71e9bce111e9429c "%> Tag to limit the controlthe means permissions for SharePoint. To limit access to our checks we should add tag SPSecurityTrimmedControl and PermissionsString, all controls that are within the tag are attached to permission Sharepoint, if no permission can not access. Example <SharePointWebControls: SPSecurityTrimmedControl ID = "AgendaPermission" runat= "server" PermissionsString= "addListItems"><asp: TextBox runat= "server" id = "TextBox1"> </asp: TextBox><br><br><asp: Button runat= "server" Text = "Save"id =" Button1 "> </asp: Button></SharePointWebControls: SPSecurityTrimmedControl> Here is List of Permissions in SharePoint. http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx List Permissions- ManageLists
- CancelCheckout
- AddListItems
- EditListItems
- DeleteListItems
- ViewListItems
- ApproveItems
- OpenItems
- ViewVersions
- DeleteVersions
- CreateAlerts
- ViewFormPages
Site Permissions- ManagePermissions
- ViewUsageData
- ManageSubwebs
- ManageWeb
- AddAndCustomizePages
- ApplyThemeAndBorder
- ApplyStyleSheets
- CreateGroups
- BrowseDirectories
- CreateSSCSite
- ViewPage
- EnumeratePermissions
- BrowseUserInfo
- ManageAlerts
- UseRemoteAPIs
- UseClientIntegration
- Open
- EditMyUserInfo
Personal Permissions- ManagePersonalViews
- AddDelPrivateWebParts
- UpdatePersonalWebParts
When the page is in anonymous access or user that does not have permission "addListItems" controls within the tag "SPSecurityTrimmedControl"are not visible. Example When you access our site with a user with permission to set the PermissionsString, you already can access the control, easy easy. Example With this technique we can define several states and permissions associated with the user permissions using SharePoint. I hope you enjoyed it |