Users
Type | Base Path | Trigger Name |
---|---|---|
REST resource | ~{realm}/users/ | users |
This resource holds all users (administrators, cashiers, employees, etc.) in the realm.
Endpoints
Name | Method | Relative Path | Payload | Response | Description |
---|---|---|---|---|---|
addUser | POST | ~{realm}/users/ | User | Stored_User | Adds a new user to the list. |
listUsers | GET | ~{realm}/users/ | N/A | Stored_User[] | Retrieves a list of users. |
getUser | GET | ~{realm}/users/{id} | N/A | Stored_User | Retrieves a user. |
putUser | PUT | ~{realm}/users/{id} | User | Stored_User | Replaces a user. |
updateUser | PATCH | ~{realm}/users/{id} | Partial_User | Stored_User | Updates specified user fields. |
removeUser | DELETE | ~{realm}/users/{id} | N/A | N/A | Deletes a user. |
Permissions
Permission | Description |
---|---|
edit-personal-info | Client is allowed to modify the name , alias , email , pin and password properties of the currently authorized user (assuming there is one). |
edit-users | Client is allowed to add new users and to modify or delete existing users. |
show-users | Client is allowed to query the user list and to fetch individual users. |
Entities
Interface User
namespace User {
type SystemRole = 'admin' | 'cashier' | 'service' | 'employee';
}
interface User {
'name': string;
'alias': string;
'identity-number'?: string;
'email': string;
'pin'?: Base64String;
'password'?: Base64String;
'demon'?: boolean;
'system-roles'?: User.SystemRole[];
'roles'?: number[];
'id'?: number;
'created'?: DateTime;
'updated'?: DateTime;
'deleted'?: DateTime;
'updated-by'?: number;
'updated-from'?: number;
'tags'?: string[];
'labels'?: number[];
}
Property | Data Type | Description |
---|---|---|
name | String | Name of user. |
alias | String | User alias ("login name"). |
identity-number | String? | User's identification number ("personnummer" in Sweden). |
email | String | User's email address. |
pin | Base64String? | PIN key, derived from a PIN code (see Authentication & Authorization). |
password | Base64String? | Password key, derived from a password (see Authentication & Authorization). |
demon | Boolean? | true if user is a global super-user. |
system-roles | User.SystemRole[]? | List of system roles user is a member of. Some system roles comes with a predefined list of permissions (and some don't). |
roles | Int64[]? | List of custom roles this user is a member of. |
id | Int64? | The resource ID of this entity. |
created | DateTime? | Date and time when this entity was first created. |
updated | DateTime? | Date and time when this entity was last modified. |
deleted | DateTime? | Date and time when this entity was deleted. |
updated-by | Int64? | ID of User who last modified this entity. |
updated-from | Int64? | ID of Till (trusted device) which last modified this entity. |
labels | Int64[]? | A list of Label IDs associated with this entity. |