Table of Contents

Class OpenBiApiClientUsergroupExtensions

Namespace
BiExcellence.OpenBi.Api.Usergroups
Assembly
BiExcellence.OpenBi.Api.Client.dll

Extension methods for the /usergroups REST API.

public static class OpenBiApiClientUsergroupExtensions
Inheritance
object
OpenBiApiClientUsergroupExtensions

Methods

AssignUsergroupObjectAsync(IOpenBiApiClient, string, string, CancellationToken)

Links a stored object to this usergroup by its id. Idempotent. Throws OpenBiApiException (404) when the usergroup does not exist; the object id is not checked. RemoveUsergroupObjectAsync(IOpenBiApiClient, string, string, CancellationToken) undoes it.

public static Task AssignUsergroupObjectAsync(this IOpenBiApiClient client, string usergroupId, string objectId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
objectId string
cancellationToken CancellationToken

Returns

Task

AssignUsergroupOrganisationAsync(IOpenBiApiClient, string, string, CancellationToken)

Links an organisation to this usergroup, scoping what data the whole group sees. Idempotent. Throws OpenBiApiException (404) when the usergroup or the organisation does not exist. RemoveUsergroupOrganisationAsync(IOpenBiApiClient, string, string, CancellationToken) undoes it.

public static Task AssignUsergroupOrganisationAsync(this IOpenBiApiClient client, string usergroupId, string organisationId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
organisationId string
cancellationToken CancellationToken

Returns

Task

AssignUsergroupPermissionAsync(IOpenBiApiClient, string, string, CancellationToken)

Grants a permission to this usergroup - the same link as AssignPermissionUsergroupAsync(IOpenBiApiClient, string, string, CancellationToken). Members get it with their next access token; a token already issued keeps the scope it was issued with. Idempotent. Throws OpenBiApiException (404) when the usergroup or the permission does not exist. RemoveUsergroupPermissionAsync(IOpenBiApiClient, string, string, CancellationToken) undoes it.

public static Task AssignUsergroupPermissionAsync(this IOpenBiApiClient client, string usergroupId, string permissionId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
permissionId string
cancellationToken CancellationToken

Returns

Task

AssignUsergroupRoleAsync(IOpenBiApiClient, string, string, RoleAssignmentRequest?, CancellationToken)

Links a role to this usergroup, giving every member access to its content. The optional assignment sets the link's validity and edit/delete rights; without one, or for a date it leaves unset, the link is valid from now for 30 days and allows neither editing nor deleting. Assigning again replaces those fields. Throws OpenBiApiException (404) when the usergroup or the role does not exist. RemoveUsergroupRoleAsync(IOpenBiApiClient, string, string, CancellationToken) undoes it.

public static Task AssignUsergroupRoleAsync(this IOpenBiApiClient client, string usergroupId, string roleId, RoleAssignmentRequest? assignment = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
roleId string
assignment RoleAssignmentRequest
cancellationToken CancellationToken

Returns

Task

AssignUsergroupUserAsync(IOpenBiApiClient, string, string, CancellationToken)

Adds a user to this usergroup - the same link as AssignUserUsergroupAsync(IOpenBiApiClient, string, string, CancellationToken). Idempotent. Throws OpenBiApiException (404) when the usergroup or the user does not exist. RemoveUsergroupUserAsync(IOpenBiApiClient, string, string, CancellationToken) undoes it.

public static Task AssignUsergroupUserAsync(this IOpenBiApiClient client, string usergroupId, string userId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
userId string
cancellationToken CancellationToken

Returns

Task

CreateUsergroupAsync(IOpenBiApiClient, Usergroup, CancellationToken)

Creates a usergroup; the server generates the id when it is left unset. An empty group grants nothing until permissions are assigned with AssignUsergroupPermissionAsync(IOpenBiApiClient, string, string, CancellationToken). UpdateUsergroupAsync(IOpenBiApiClient, string, Usergroup, CancellationToken) creates as well, for a caller that picks the id.

public static Task<Usergroup?> CreateUsergroupAsync(this IOpenBiApiClient client, Usergroup usergroup, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroup Usergroup
cancellationToken CancellationToken

Returns

Task<Usergroup>

DeleteUsergroupAsync(IOpenBiApiClient, string, CancellationToken)

Deletes a usergroup together with its links to users, organisations, permissions, roles, role content and objects. Its members keep existing and lose the rights this group gave them.

public static Task DeleteUsergroupAsync(this IOpenBiApiClient client, string id, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task

GetUsergroupAsync(IOpenBiApiClient, string, CancellationToken)

Reads one usergroup by id. Throws OpenBiApiException (404) when there is no usergroup with this id.

public static Task<Usergroup> GetUsergroupAsync(this IOpenBiApiClient client, string id, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task<Usergroup>

GetUsergroupObjectsAsync(IOpenBiApiClient, string, CancellationToken)

Lists the objects linked to this usergroup - object-level access for single stored objects, used where a role is too coarse.

public static Task<OpenBiListResult<UsergroupObjectAssignment>> GetUsergroupObjectsAsync(this IOpenBiApiClient client, string usergroupId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<UsergroupObjectAssignment>>

GetUsergroupOrganisationsAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken)

Lists the organisations of this usergroup, which scope what data the whole group sees.

public static Task<OpenBiListResult<Organisation>> GetUsergroupOrganisationsAsync(this IOpenBiApiClient client, string usergroupId, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<Organisation>>

GetUsergroupPermissionsAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken)

Lists the permissions of this usergroup. This is what actually grants a right: every member of the group holds these permission ids.

public static Task<OpenBiListResult<Permission>> GetUsergroupPermissionsAsync(this IOpenBiApiClient client, string usergroupId, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<Permission>>

GetUsergroupRolesAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken)

Lists the roles of this usergroup, whose content - dashboards, reports, CMS pages - every member may open.

public static Task<OpenBiListResult<Role>> GetUsergroupRolesAsync(this IOpenBiApiClient client, string usergroupId, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<Role>>

GetUsergroupUsersAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken)

Lists the users of this usergroup - the same link that GetUserUsergroupsAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken) reads from the other side.

public static Task<OpenBiListResult<User>> GetUsergroupUsersAsync(this IOpenBiApiClient client, string usergroupId, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<User>>

GetUsergroupsAsync(IOpenBiApiClient, OpenBiListRequest?, CancellationToken)

Lists usergroups, with the shared list options of request. A usergroup is where rights live: permissions attach to it, never to a user directly, so granting someone a right means putting them in a group that has it.

public static Task<OpenBiListResult<Usergroup>> GetUsergroupsAsync(this IOpenBiApiClient client, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<Usergroup>>

QueryUsergroupsAsync(IOpenBiApiClient, OpenBiListRequest?, CancellationToken)

Lists usergroups with the options in the request body instead of in the query string - the QUERY-method form of the list route, for filters that do not fit in a URL.

public static Task<OpenBiListResult<Usergroup>> QueryUsergroupsAsync(this IOpenBiApiClient client, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<Usergroup>>

RemoveUsergroupObjectAsync(IOpenBiApiClient, string, string, CancellationToken)

Unlinks an object from this usergroup. Removes the link only; the object itself stays. Removing a link that is not there is not an error.

public static Task RemoveUsergroupObjectAsync(this IOpenBiApiClient client, string usergroupId, string objectId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
objectId string
cancellationToken CancellationToken

Returns

Task

RemoveUsergroupOrganisationAsync(IOpenBiApiClient, string, string, CancellationToken)

Unlinks an organisation from this usergroup. Removes the link only; the organisation itself stays. Removing a link that is not there is not an error.

public static Task RemoveUsergroupOrganisationAsync(this IOpenBiApiClient client, string usergroupId, string organisationId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
organisationId string
cancellationToken CancellationToken

Returns

Task

RemoveUsergroupPermissionAsync(IOpenBiApiClient, string, string, CancellationToken)

Revokes a permission from this usergroup. Removes the link only; the permission itself stays. Members lose it with their next access token. Removing a link that is not there is not an error.

public static Task RemoveUsergroupPermissionAsync(this IOpenBiApiClient client, string usergroupId, string permissionId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
permissionId string
cancellationToken CancellationToken

Returns

Task

RemoveUsergroupRoleAsync(IOpenBiApiClient, string, string, CancellationToken)

Unlinks a role from this usergroup. Removes the link only; the role itself stays. Removing a link that is not there is not an error.

public static Task RemoveUsergroupRoleAsync(this IOpenBiApiClient client, string usergroupId, string roleId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
roleId string
cancellationToken CancellationToken

Returns

Task

RemoveUsergroupUserAsync(IOpenBiApiClient, string, string, CancellationToken)

Removes a user from this usergroup. Removes the link only; the user itself stays. Removing a link that is not there is not an error.

public static Task RemoveUsergroupUserAsync(this IOpenBiApiClient client, string usergroupId, string userId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
usergroupId string
userId string
cancellationToken CancellationToken

Returns

Task

UpdateUsergroupAsync(IOpenBiApiClient, string, Usergroup, CancellationToken)

Creates or updates the usergroup with this id: an id that is not there yet is inserted rather than answered with a 404.

public static Task<Usergroup?> UpdateUsergroupAsync(this IOpenBiApiClient client, string id, Usergroup usergroup, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
usergroup Usergroup
cancellationToken CancellationToken

Returns

Task<Usergroup>