2009-04-21

Item level permission checking web part


So you want to know what a specific user can and can't see in your SharePoint site?... well for that you'll need to perform an eye examination.


OK really you want to know what items/list/sites for which a specific user has access?
Well believe it or not you can't with the standard SharePoint tools, but it's a fairly simple exercise to create a web part that does, and to save time here's one I made before.




It's fairly simple... get the SPUser > Check what groups he/she belongs to > loop through all the lists > items then the sub sites...

I show an icon for SPBasePermissions instead of the usual Full Control, Contribute, ect. The tree goes down to items, but won't fetch them until you click on the list expand icon to aid performance.
Since I'm using SPUser it also works for forms authentication.
If you don't have permission to check permissions on an object you can set a web part property to show this or not.

In any event the whole project source is included, so feel free to play and recommend changes.


Keywords: Check User Permission Inherited Unique Access RenderPreText RenderPostText TreeNode PeopleEditor SPUser TreeView SPGroup HasUniqueRoleAssignments TreeNodePopulate



No comments :

Post a Comment