From the Dashboard
With APIs
Create a new role
A role is a whitelist of all permissions a user is allowed to use. Roles are designed to be assigned to users to help secure your organization by enforcing the principle of least privilege.
As any other modification you make on your organization, this action needs to be signed as described in User Action Signing. That’s what we will point your to bellow.
- Select a name for your role, and the permissions to whitelist. Here, only allowing assigned users read-only access to the wallets:
- Follow the process here to authorize the action request a get a
userActiontoken that you can include in your request as theX-DFNS-USERACTIONheader. - Call the permission creation endpoint:
POST /permissions
In the response, keep a note of the role
id, you will need it to assign it to the user in the last step of this tutorial.That’s it! You have created a new role! Now, let’s get it assigned to a new user.
Invite a New User
We will invite a new User as an employee from your company. Employees can also access the dashboard and use the APIs. If you want to invite your End users then look at Delegated Registration.
As any other modification you make on your organization, this action needs to be signed as described in User Action Signing. That’s what we will point your to bellow.
- When you invite a user, they will receive a registration email with a code allowing them to register to your organization. That user will be created without any role. Just input their email:
- Follow the process here to authorize the action request a get a
userActiontoken that you can include in your request as theX-DFNS-USERACTIONheader. - Call the user creation endpoint:
POST /auth/usersto initiate the registration process.
In the response, keep a note of the
userId, you will need it to assign the role in the next step.The new user has been created and has received instructions to create their own credentials. We don’t need to wait for them to complete their registration, let’s go ahead and assign them our role!
Assign the role
Final step! Let’s give our user the rights they deserve! We will use the assign permission endpoint to link the role to the user we just created
As any other modification you make on your organization, this action needs to be signed as described in User Action Signing. That’s what we will point your to bellow.
- Not much choice here, just input the ids gathers above:
- Follow the process here to authorize the action request a get a
userActiontoken that you can include in your request as theX-DFNS-USERACTIONheader. - Call the permission assignment endpoint:
POST /permissions/{permission id}/assignmentsto assign the role:
This endpoint is not idempotent. Assigning a role that is already assigned to the user returns a
409 Conflict error.Congrats! You have built the base of a tailored identity management setup, you can now keep refining and assign roles to your complete user base.
