How can I find out programmatically if current user belongs to some group on sharepoint website?
We can use below code:
SPWeb site = SPContext.Current.Web;
SPGroup managerGroup = site.Groups["Your_Group_Name"];
bool isManager = site.IsCurrentUserMemberOfGroup(managerGroup.ID);
Hope this helps!!!!
We can use below code:
SPWeb site = SPContext.Current.Web;
SPGroup managerGroup = site.Groups["Your_Group_Name"];
bool isManager = site.IsCurrentUserMemberOfGroup(managerGroup.ID);
Hope this helps!!!!
No comments:
Post a Comment