About      |       Articles      |      Services      |      Software      |      Contact

Latest Free SharePoint Software

ARB Security Solutions regularly releases free SharePoint software, including WebParts, Client Applications, Framework Extensions, and other Miscellaneous Components.
The most recent freeware is:

Title: Simple SharePoint Rollup WebPart
Date Published: 10/22/2009

Previous Two Free WebPart Releases:

SecureCenter For SharePoint

By SharePoint security integrators, for SharePoint security integrators.

SharePoint Security Assurance Program™

For externally facing SharePoint deployments, security is an acutely important deployment concern. Learn how through daily security scanning, you can ensure external business users and partners that they can collaborate in confidence!

Security Assurance WebPart:



SharePoint Security Tip: ExplicitlyContainsCurrentUser

When doing security programming, often times you will often run into group chaining, essentially this is when the current SPUser object is a member of a SPGroup through indirect association. However, often times the software requirement will be targeted to direct SPUser group membership, i.e. a user is an EXPLICIT member of a group, and not in a SPGroup which is nested in a parent SPGroup.

Within code, the use is pretty straightforward:

C#:
  1. private void RemoveCurrentUserFromGroup(SPGroup group)
  2. {
  3. SPUser curUser = SPContext.Current.Web.CurrentUser;
  4. if (group.ExplicitlyContainsCurrentUser)
  5. {
  6. group.Users.Remove(curUser.LoginName);
  7. }
  8. }

  • Share/Bookmark

3 Comments »

  1. .

    Comment by . — December 17, 2008 @ 10:23 am

  2. ohhhh, OP is from Defense Logistics Agency….I am guessing Kirk?

    Comment by Adam Buenz — December 17, 2008 @ 10:55 am

  3. [...] http://www.sharepointsecurity.com/blog/sharepoint/sharepoint-security-tip-explicitlycontainscurrentuser/ [...]

    Pingback by SharePoint Security Tip- SPuser and SPGroups, ExplicitlyContainsCurrentUser « Marty’s Scribbles — December 19, 2008 @ 5:46 am

RSS feed for comments on this post. TrackBack URL

Leave a comment