Class OpenBiUserExtensions
Extension methods for users.
Inheritance
Namespace: BiExcellence.OpenBi.Api.Commands.Users
Assembly: BiExcellence.OpenBi.Api.User.dll
Syntax
public static class OpenBiUserExtensions
Methods
AssignUserToOrganisationAsync(IOpenBiSession, string, string, CancellationToken)
Assigns an user to an organisation.
Declaration
public static Task AssignUserToOrganisationAsync(this IOpenBiSession session, string username, string organisationId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | username | The username. |
string | organisationId | The organisation id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
AssignUserToRoleAsync(IOpenBiSession, string, string, CancellationToken)
Assigns an user to a role.
Declaration
public static Task AssignUserToRoleAsync(this IOpenBiSession session, string username, string roleId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | username | The username. |
string | roleId | The role id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
AssignUserToUsergroupAsync(IOpenBiSession, string, string, CancellationToken)
Assigns an user to an usergroup.
Declaration
public static Task AssignUserToUsergroupAsync(this IOpenBiSession session, string userId, string usergroupId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | userId | The username. |
string | usergroupId | The usergroup id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
ChangePasswordAsync(IOpenBiSession, IUser, string, string, CancellationToken)
Changes the password for an user.
Declaration
public static Task ChangePasswordAsync(this IOpenBiSession session, IUser user, string oldPassword, string newPassword, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
IUser | user | The user. |
string | oldPassword | The old password. |
string | newPassword | The new password. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
ChangePasswordAsync(IOpenBiSession, string, string, string, CancellationToken)
Changes the password for an user.
Declaration
public static Task ChangePasswordAsync(this IOpenBiSession session, string username, string oldPassword, string newPassword, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | username | The username. |
string | oldPassword | The old password. |
string | newPassword | The new password. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
CreateUserAsync(IOpenBiSession, IUser, string?, CancellationToken)
Creates or updates an user.
Declaration
public static Task CreateUserAsync(this IOpenBiSession session, IUser user, string? password, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
IUser | user | The user. |
string | password | The new password for the user (can be omitted |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
CreateUserAsync(IOpenBiSession, IUser, CancellationToken)
Creates or updates an user.
Declaration
public static Task CreateUserAsync(this IOpenBiSession session, IUser user, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
IUser | user | The user. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
DeleteUserAsync(IOpenBiSession, IUser, CancellationToken)
Deletes an user.
Declaration
public static Task DeleteUserAsync(this IOpenBiSession session, IUser user, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
IUser | user | The user. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
DeleteUserAsync(IOpenBiSession, string, CancellationToken)
Deletes an user by username.
Declaration
public static Task DeleteUserAsync(this IOpenBiSession session, string id, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | id | The username. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
DeleteUsersAsync(IOpenBiSession, IEnumerable<IUser>, CancellationToken)
Deletes users.
Declaration
public static Task DeleteUsersAsync(this IOpenBiSession session, IEnumerable<IUser> users, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
IEnumerable<IUser> | users | The users. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
DeleteUsersAsync(IOpenBiSession, IEnumerable<string>, CancellationToken)
Deletes users by usernames.
Declaration
public static Task DeleteUsersAsync(this IOpenBiSession session, IEnumerable<string> usernames, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
IEnumerable<string> | usernames | The usernames. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
GetUserByUsernameAsync(IOpenBiSession, string, CancellationToken)
Returns an user by its username.
Declaration
public static Task<IUser?> GetUserByUsernameAsync(this IOpenBiSession session, string username, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | |
string | username | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IUser> |
GetUsers(IOpenBiSession)
Returns users.
Declaration
public static IListRequest<IUser> GetUsers(this IOpenBiSession session)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session |
Returns
Type | Description |
---|---|
IListRequest<IUser> |
GetUsersByOrganisationAsync(IOpenBiSession, string, CancellationToken)
Returns all users for an organisation.
Declaration
public static Task<IList<IUser>> GetUsersByOrganisationAsync(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<IUser>> |
GetUsersByRoleAsync(IOpenBiSession, string, CancellationToken)
Returns all users for a role.
Declaration
public static Task<IList<IUser>> GetUsersByRoleAsync(this IOpenBiSession session, string roleId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | roleId | The role id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IList<IUser>> |
GetUsersByUsergroupAsync(IOpenBiSession, string, CancellationToken)
Returns all users for an usergroup.
Declaration
public static Task<IList<IUser>> GetUsersByUsergroupAsync(this IOpenBiSession session, string usergroupId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | usergroupId | The usergroup id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IList<IUser>> |
RemoveUserFromOrganisationAsync(IOpenBiSession, string, string, CancellationToken)
Removes an user from an organisation.
Declaration
public static Task RemoveUserFromOrganisationAsync(this IOpenBiSession session, string username, string organisationId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | username | The username. |
string | organisationId | The organisation id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
RemoveUserFromRoleAsync(IOpenBiSession, string, string, CancellationToken)
Removes an user from a role.
Declaration
public static Task RemoveUserFromRoleAsync(this IOpenBiSession session, string username, string roleId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | username | The username. |
string | roleId | The role id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
RemoveUserFromUsergroupAsync(IOpenBiSession, string, string, CancellationToken)
Removes an user from an usergroup.
Declaration
public static Task RemoveUserFromUsergroupAsync(this IOpenBiSession session, string username, string usergroupId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | username | The username. |
string | usergroupId | The usergroup id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |