Get all User Group Links

How can I get all groups that current person is connected to in Litium. Using SecurityToken.CurrentSecurityToken.Person.GroupLinks only returns one record even though I have added several different groups (one special for special permissions).

Litium version: 7.2

var groupLinks = _securityToken.Person.GroupLinks.ToList();
So you only get one link in the list?

Yes - at least using SecurityToken.CurrentSecurityToken.Person.GroupLinks.ToList();

And var groupLinks = _securityToken.Person.GroupLinks.ToList(); also return one result even though I have added 3 groups to person.

Ok it “might” be a bug. Let’s see if someone from R&D has an explanation?

Just to make sure - are you logged in as the user?
Do you still only get 1 result if you try and get the person using the PersonService?

I tried both with PersonService and CurrentSecurityToken, and got all groups both times.

I do still only get one result Attached are some xcreen dumps on what I have.

Seems I was logged in with different account than the username I used… not sure why but after adding group to my “test” account as well it works… Thanks.

1 Like