You wants to check if CurrentUser or particular User / SPUser is present in specific site's permission group or not,
Usually site have three groups Visitors, Members and Owners. If you have create another group and wants to check if particular user is present is that group for some validation so you can refer below code sample,
* Assuming you have basic knowledge of SharePoint coding.
Usually site have three groups Visitors, Members and Owners. If you have create another group and wants to check if particular user is present is that group for some validation so you can refer below code sample,
* Assuming you have basic knowledge of SharePoint coding.
Code:
If you wants to check user from Sites default Visitor, Member or Owner Group you can directly get group by below property
If you wants to check user from Sites default Visitor, Member or Owner Group you can directly get group by below property
- SPWeb.AssociatedVisitorGroup
- SPWeb.AssociatedMemberGroup
- SPWeb.AssociatedOwnerGroup
--
Thanks,
Praveen Pandit
No comments:
Post a Comment