pub struct UserApi<'a> { /* private fields */ }Implementations§
Source§impl<'a> UserApi<'a>
Sub-API for user endpoints.
impl<'a> UserApi<'a>
Sub-API for user endpoints.
Sourcepub async fn checkperm(
&self,
request: CheckpermRequest,
) -> Result<Value, RsError>
pub async fn checkperm( &self, request: CheckpermRequest, ) -> Result<Value, RsError>
Find out if the current user has a particular permission. The permission strings are shown in the ResourceSpace UI when managing group permissions.
§Arguments
request- Parameters built viaCheckpermRequest
§Returns
TRUE if the user has the permission, FALSE if they don’t.
§TODO: Errors
§TODO: Examples
Sourcepub async fn get_users(
&self,
request: GetUsersRequest,
) -> Result<Value, RsError>
pub async fn get_users( &self, request: GetUsersRequest, ) -> Result<Value, RsError>
Retrieve a list of users
Permissions are always honoured so users from other groups to which this user does not have access will be omitted.
§Arguments
request- Parameters built viaGetUsersRequest
§Returns
An array of matching user records include ID (“ref”), username, full name and user group ID.
§TODO: Errors
§TODO: Examples
Sourcepub async fn get_users_by_permission(
&self,
request: GetUsersByPermissionRequest,
) -> Result<Value, RsError>
pub async fn get_users_by_permission( &self, request: GetUsersByPermissionRequest, ) -> Result<Value, RsError>
Retrieve information on all users with the given permissions
Permissions are always honoured so users from groups to which this user does not have access will be omitted.
§Arguments
request- Parameters built viaGetUsersByPermissionRequest
§Returns
An array of matching user records with a subset of information from the user record
§TODO: Errors
§TODO: Examples
Sourcepub async fn mark_email_as_invalid(
&self,
request: MarkEmailAsInvalidRequest,
) -> Result<Value, RsError>
pub async fn mark_email_as_invalid( &self, request: MarkEmailAsInvalidRequest, ) -> Result<Value, RsError>
Mark a specified email address as invalid.
Email addresses marked as invalid will be blocked before send_mail() tries to dispatch any emails, this will be applied to any users with this email address.
§Arguments
request- Parameters built viaGetUsersByPermissionRequest
§Returns
Boolean - true if one or more users are found and mark as having invalid adresses, false otherwise.
§TODO: Errors
§TODO: Examples
Sourcepub async fn save_user(
&self,
request: SaveUserRequest,
) -> Result<Value, RsError>
pub async fn save_user( &self, request: SaveUserRequest, ) -> Result<Value, RsError>
Save a user record.
Use new_user first to create the user, then call this with the
returned ID to populate the user’s details.
§Arguments
request- Parameters built viaSaveUserRequest
§Returns
Returns Ok(()) on success (HTTP 200). Returns an error on HTTP 409 (e.g. missing
required fields) or HTTP 403 (permission denied).
§TODO: Errors
§TODO: Examples
Sourcepub async fn new_user(&self, request: NewUserRequest) -> Result<Value, RsError>
pub async fn new_user(&self, request: NewUserRequest) -> Result<Value, RsError>
Create a new user record.
Create a user record. Use the returned ID to then call save_user() with the user details.
§Arguments
request- Parameters built viaNewUserRequest
§Returns
The new user ID in data.ref on success (HTTP 200).
HTTP 409 if the username already exists (data.ref = false) or the user limit has
been reached (data.ref = -2). HTTP 403 on permission failure.