Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Programmatically Check whether Current Logged in User is a Member of SharePoint User Group or Not
WhatsApp
Abhay Shanker
11y
42.5
k
0
1
25
Blog
SharePoint Custom development requires to check whether the current logged in user is a member of any particular SharePoint User Group or not. We can solve this issue by using the code block given below.
bool
isMember =
false
;
SPSecurity.RunWithElevatedPrivileges(
delegate
{
using
(SPSite site =
new
SPSite(
"http://siteurl"
))
{
SPWeb web = site.RootWeb;
string
groupName =
"Site Group Name"
;
var spGroup = web.Groups[groupName];
isMember = web.IsCurrentUserMemberOfGroup(spGroup.ID);
}
});
Programmatically check whether current logged in user is a member of SharePoint User Group or not
Up Next
Check Current User Is Belongs To A Group In SharePoint 2013 Using JSOM
Ebook Download
View all
Getting Started with SharePoint Framework Development using TypeScript, PnP JS, and React JS
Read by 4.9k people
Download Now!
Learn
View all
Membership not found