Checking if User is Member of Group

Discussions related to SoftPro Select user interface development.

Moderator: Phil Barton

Post Reply
tmeisinger
Posts: 67
Joined: Fri Apr 24, 2015 10:33 am

Checking if User is Member of Group

Post by tmeisinger » Thu Nov 08, 2018 2:10 pm

In my Client Shell, I know the current user is a member of a group, but my Contains statement is always False. Any ideas?

Code: Select all

            // Select Server
            SelectServer ss = GetService<SelectServer>();

            // Security Manager
            ISecurityManager sm = ss.GetService<ISecurityManager>();

            // Get Current User
            ISecurityUser CurrentUser = sm.GetUser(sm.CurrentSecurityIdentityID);

            // Get Group
            ISecurityIdentity gsi = sm.Identities.Where(t => t.Name == "Title Officer" && t.IsGroup).FirstOrDefault();
            ISecurityGroup Group = sm.GetGroup(gsi);

            bool TitleOfficer = Group.Members.Contains(CurrentUser);
 

BobRichards
Posts: 929
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Checking if User is Member of Group

Post by BobRichards » Tue Nov 13, 2018 3:55 pm

Are you looking for membership in a Position (Title officer/Examiner, Escrow assisting/Pre-closer, etc. checkboxes on each user) or Group membership as in SPAdmin Security/Groups? Your intent is a bit unclear.
Bob Richards, Software Developer, SoftPro

tmeisinger
Posts: 67
Joined: Fri Apr 24, 2015 10:33 am

Re: Checking if User is Member of Group

Post by tmeisinger » Wed Nov 14, 2018 10:55 am

Sorry, I'm looking for a Group Membership, the Security Group is called "Title Officer".

Post Reply