Listing roles
Log in to add to favouritesRequesting a list of role can be achieved by using one of the List operations.
List
Lists all roles assigned to a project.
Syntax
public PagedList<Role> List(PagingOptions pagingOptions = null)
{
}
Parameters
pageOptions
Type: PageOptions<Role>
The options for paging the results.
Return value
Type: PagedList<Role>
Remarks
The API Key user must be part of the Roles Administrators
group to be able to list roles.
Example
This example shows how roles can be listed for a project.
using Zengenti.Contensis.Management;
var client = ManagementClient.Create();
// Access the movie DB project
var project = client.Projects.Get("movieDb");
// List the roles with the default paging options
var roles = project.Security.Roles.List();
ListAsync
Lists all roles assigned to a project asynchronously.
Syntax
public async Task<PagedList<Role>> ListAsync(PagingOptions pagingOptions = null)
{
}
Parameters
pageOptions
Type: PageOptions<Role>
The options for paging the results.
Return value
Type: Task<PagedList<Role>>
Example
This example shows how roles can be listed for a project.
using Zengenti.Contensis.Management;
var client = ManagementClient.Create();
// Access the movie DB project
var project = await client.Projects.GetAsync("movieDb");
// List the roles with specific paging options
var roles = await project.Security.Roles.ListAsync(new PageOptions(pageIndex: 0, pageSize: 10));