You can assign permissions to users, SharePoint groups and Active Directory groups in SharePoint. While SharePoint groups cannot contain other SharePoint groups, it is possible to nest Active Directory Groups. The SharePoint method SPGroup.Users only returns users that are added directly to the SharePoint Group. I have written a small function that is able to retrieve all users of a SPPrincipal object, included nested users.
Posts Tagged ‘Permissions’
Retrieving all (nested) members of a Group
August 20th, 2012 Alain
Posted in Collaboration, Featured, SharePoint, SharePoint 2010 Tags: Membership, Permissions No Comments »
Conditionally enable/disable Ribbon buttons based on user permissions
May 20th, 2012 Alain
Using custom action you can create your own ribbon elements. In a post I have published a while ago I showed how to add a button to the ribbon to generate a QR-Code. But what if you want your button only to be enabled under certain circumstances. For example; if the user has sufficient privileges.
Checking user permissions: DoesUserHavePermissions vs. CatchAccessDeniedException
April 11th, 2012 Alain
I recently had a nice discussion with a colleague about the best way to check if the current user has permissions to view a specified SharePoint list in a SP2010 site using C#.
Basically there are 2 ways to check for permissions:
1) SPSecurableObject.DoesUserHavePermissions
2) SPSecurity.CatchAccessDeniedException
This post discusses both methods, proposes implementations and discusses the pro’s and cons.