Class OpenBiRoleExtensions
Extension methods for roles.
Inheritance
OpenBiRoleExtensions
Namespace: BiExcellence.OpenBi.Api.Commands.Roles
Assembly: BiExcellence.OpenBi.Api.Role.dll
Syntax
public static class OpenBiRoleExtensions
Methods
CreateRoleAsync(IOpenBiSession, IRole, CancellationToken)
Creates or updates a role.
Declaration
public static Task CreateRoleAsync(this IOpenBiSession session, IRole role, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
IRole | role | The role. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
DeleteRoleAsync(IOpenBiSession, IRole, CancellationToken)
Deletes a role.
Declaration
public static Task DeleteRoleAsync(this IOpenBiSession session, IRole role, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
IRole | role | The role. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
DeleteRoleAsync(IOpenBiSession, string, CancellationToken)
Deletes a role by id.
Declaration
public static Task DeleteRoleAsync(this IOpenBiSession session, string roleId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | roleId | Thr role id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
DeleteRolesAsync(IOpenBiSession, IEnumerable<IRole>, CancellationToken)
Deletes roles.
Declaration
public static Task DeleteRolesAsync(this IOpenBiSession session, IEnumerable<IRole> roles, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
IEnumerable<IRole> | roles | The roles. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
DeleteRolesAsync(IOpenBiSession, IEnumerable<string>, CancellationToken)
Deletes roles by id.
Declaration
public static Task DeleteRolesAsync(this IOpenBiSession session, IEnumerable<string> ids, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
IEnumerable<string> | ids | The role ids. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
GetRoleByIdAsync(IOpenBiSession, string, CancellationToken)
Returns a role by its id.
Declaration
public static Task<IRole?> GetRoleByIdAsync(this IOpenBiSession session, string id, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | id | The role id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IRole> |
GetRoles(IOpenBiSession)
Returns roles.
Declaration
public static IListRequest<IRole> GetRoles(this IOpenBiSession session)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
Returns
Type | Description |
---|---|
IListRequest<IRole> |
GetRolesByOrganisationAsync(IOpenBiSession, string, CancellationToken)
Returns all roles for an organisation.
Declaration
public static Task<IList<IRoleAssignment>> GetRolesByOrganisationAsync(this IOpenBiSession session, string organisationId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | organisationId | The organisation id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IList<IRoleAssignment>> |
GetRolesByUsernameAsync(IOpenBiSession, string, CancellationToken)
Returns all roles for an user.
Declaration
public static Task<IList<IRoleAssignment>> GetRolesByUsernameAsync(this IOpenBiSession session, string username, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | username | The username. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IList<IRoleAssignment>> |