Posted By

scholli on 10/28/10


Tagged

sharepoint


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


Is current user member of group


 / Published in: C#
 

  1. bool isMember = false;
  2. SPWeb oWeb = SPContext.Current.Web;
  3. isMember = web.IsCurrentUserMemberOfGroup(web.Groups["Your Group"].ID);
  4.  
  5. // Check If user belong to your group.
  6. if (isMember==false)
  7. {
  8. //Redirect to AccessdDenied.aspx
  9. }

Report this snippet  

You need to login to post a comment.