Skip to main content

Get group memberships

Log in to add to favourites

List with page options

C#
1
2
3
public PagedList<Group> Groups(SecurityListOptions listOptions = null, bool includeInherited = false) { }
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using Zengenti.Contensis.Management; // Create a client var client = ManagementClient.Create(); // Mimic a guid value var userId = Guid.Parse("c5da1719-cb3f-4f2e-927b-f678293258f3"); // Get the user User user = client.Security.Users.Get(userId); // Setup the list options, setting a page size of 10 and ordering by group name SecurityListOptions listOptions = new SecurityListOptions { PageOptions = new PageOptions(0, 10), Order = "name" }; // List the group memberships including inherited groups PagedList<Group> groups = user.Groups(listOptions, true);

List with page options async

C#
1
2
3
public async Task<PagedList<Group>> GroupsAsync(SecurityListOptions listOptions = null, bool includeInherited = false) { }
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using Zengenti.Contensis.Management; // Create a client var client = ManagementClient.Create(); // Mimic a guid value var userId = Guid.Parse("c5da1719-cb3f-4f2e-927b-f678293258f3"); // Get the user User user = await client.Security.Users.GetAsync(userId); // Setup the list options, setting a page size of 10 and ordering by group name SecurityListOptions listOptions = new SecurityListOptions { PageOptions = new PageOptions(0, 10), Order = "name" }; // List the group memberships including inherited groups PagedList<Group> groups = await user.GroupsAsync(listOptions, true);

Still need help?

New support request