Users and Access Rights¶
Overview¶
This section covers the following use cases:
- How to add a new user
- How to reset a pin counter for account activation
- How to add a machine user
- How to create and revoke access tokens
- How to change the access permissions of a user
- How to create and change permission roles
- How to export and import permission roles
- How to assign permission roles to user groups
Add a new user¶
Step 1: Create new user¶
Navigate to the Admin application and click the button + Profile in the section Users.

Create a new user
Step 2: Enter user details¶
Enter the information about the user, at least "Username" and "E-Mail" (please make sure, the email address is entered all in lower case letters).
Click Save.
- An activation email will be automatically sent to the email address of the user. The users can follow the instructions of the email to activate the account and set a password.
- 2FA stands for 2 Factor Authentication via VPN (Virtual Private Network). Per default, it is not configured, so leave it switched off.
- Optionally, you can already upload a profile picture.

User details form
Step 3: Add or remove the user to/from a user group¶
The newly created users (Human and Machine) have to be added to a user group to get the related permissions.
Navigate to the Admin application and in the section Groups select the group you want to add your users (e.g. "Study Team").
- You see if a user has already activated his/her account
- In the list "Available Users" you can click the
Add Userbutton in the column "Actions" to add a user to the group. Users that are already in the group appear in the list "Selected Users" and are greyed out in the list "Available Users". - After you added all users to the group, click the
Savebutton. - To remove a user from a Group, click the related
Removebutton in the "Selected Users" list and then click theSavebutton.

Manage users in groups
Reset pin counter¶
If a user fails five times to enter the correct pin to activate their account, an Admin can reset the pin counter by navigating to the Admin app and then to the Users section. In the list of users, the status of the pin trials is displayed. After clicking on a user with red status, the pin trials can be reset using the button reset pin counters.

Reset pin counters
Add a machine user¶
Follow steps 1 to 3 of the section Add a new user above, but in step 2 "Enter Details", change User kind to Machine from the drop-down menu (see picture below).
For machine users, only a username has to be defined.

Add a machine user
Instead of username and password, machines use a token to authenticate themselves. While it is also possible to generate tokens for human users, it is a requirement for machine users. Follow the section Create and revoke access tokens below to create an access token for your newly created machine user.
Create and revoke access tokens¶
Navigate to the Admin application and in the section Users click on the user in the list, for which you want to create a new token.
If you do not see the user in the list, make sure that the right User kind, ie. Human or Machine, is selected in the filter above the list.
In the detail view of the user, scroll down to the section Token (see image below).

Create and revoke an access token
Create and revoke token:
- Enter a name as label of your token. Make the name meaningful to be able to revoke the right token at a later point in time.
- Click the button
+ Tokento create the token. - A pop-up will appear (see image below) with the key and its public identifier. This is the only time the key will be displayed. Make sure to save the key securely. Afterwards, close the pop-up using the cross in the top-right corner.

- All created tokens are displayed in the list. You can toggle to show or hide tokens, which have already been revoked again.
- In case revoked tokens are included in the list, they are labeled accordingly with a red
Noin the column titled "Enabled". - To revoke a token, click the
Revokebutton in the corresponding row of the list.
Security
Your data is only as secure as you handle passwords and access tokens. Here are some tips to consider:
- Don't create tokens that grant wider access permissions than necessary.
- Don't embed access tokens directly into code.
- Generate new access tokens on a regular basis.
- Ensure you are in a secure network and at a private place when generating an access token.
Access
- The created token grants access according to the permissions of the user group(s), to which the corresponding user is assigned.
- Don't create keys for a user with more access rights than required for the task, in which the token is used. It is best to create a specific machine user and create a user group with the exact rights needed for what you want to use the token for.
- For more information about roles and access permissions, read the section Assign permission roles to user groups below.
Change the access permissions of a user¶
You can change the access rights of a user by changing its user group. To do so, follow the instructions in section Add or Remove the User to/from a User Group.
Create or change a permission role¶
Note
This is an advanced feature. If you require a new role and you have not been trained by Leitwert to configure your Device Hub independently, then please contact Leitwert support.
Roles are a set of permissions (e.g. view permission for a device model object), which can be granted to a user group.
If you know how to configure roles, proceed with following steps:
- To create a new role, navigate to the
Adminapplication and click the button+ Rolein the section "Roles" (see image below). Enter the name of the role. Optionally, you can add a description. Once you're done, click theSavebutton.

- To change an existing role, click on it in the displayed list of roles.
- You are now on the configuration screen of the roles. You can toggle each right individually. Once you're done, click the
Savebutton.
Export and import a permission role¶
If you want to replicate a role on a new Device Hub instance, you can import it as JSON file. To do so, follow these steps:
- Navigate to the role you would like to export and open its configuration by clicking on it in the list of available roles.
- Scroll to the bottom of the page, where you will find the section "Export / Import Role" (see image below.)
- Click on either "Export (all)" or "Export (only true permissions)". The latter is useful in case you would like to combine multiple roles into one, since it will only import true permissions to the new role you like to create, without changing the status of other permissions.
- The role is automatically saved to your clipboard in JSON. Navigate to the "Export / Import Role" section of the role, to which you would like to import the copied information. Paste the copied JSON into the "Import JSON" text box.
- Click the
Importbutton to apply the configuration to your new role. - Adapt the role as necessary or import additional permissions using the "Export (only true permission)" function.
- Once you're done, click the
Savebutton.
Assign permission roles to user groups¶
Note
This is an advanced feature. If you require a new role and you have not been trained by Leitwert to configure your Device Hub independently, then please contact Leitwert support.
In order to grant a user group certain permissions, an object authorization needs to be defined. An object authorization grants a user group the permissions defined in a role to a selection of objects from the system (e.g. the "Admin" user Group is granted the permissions of the "Device Update" Role to a specific instance of the Product object called "SuperECG").
If you need to first define a new user group, follow these steps:
- Navigate to the
Groupssection in theAdminapplication. - Click the
+ Groupbutton. Define the name of the group and optionally a description. Once done, click theSavebutton. - Add users to the group as described in Add or Remove the User to/from a User Group.
Now, you can perform an object authorization for that group as follows:
- Navigate to the
Object Authorizationssection in theAdminapplication. Click the+ Object Authorizationbutton. This will open the form pictured below.
- Choose the object type, for which the authorization should apply from the related drop-down menu. When doing so, keep in mind that permissions of a role will be applied to the assigned object including all its child objects and parent objects! To understand the object hierarchy, consult the role configuration page, which is structured accordingly.
For example (see illustration below):
You can choose to apply a role with edit rights forProfileobjects andModelobjects to a specificProductobject, which will grant the edit permission for allModelobjects of thatProduct. Alternatively, you can choose to apply the role to a specificModelobject of aProduct, which will not grant edit permissions to the otherModelsof the sameProduct. In both cases, the edit permission forProfilewill not be granted, since that is neither a child object nor a parent object ofProduct. To also grant the edit permission forProfileobjects, you would either have to assign the role to theOrganizationobject or create a second object authorization for the same user group, where you assign the role to theProfileobject.

- Choose the role with the permissions you would like to apply to that object from the related drop-down menu.
- Choose the user group, which should receive these rights.
- Optionally, add a description for this object authorization. This is highly recommended, to keep the overview when maintaining access rights.
- Once done, click the
Savebutton.