In this example, you can learn how to replace all roles and their privileges in the target Tuum environment.
In this example, we showcase the steps to replace all roles and associated privileges in the target environment using the data retrieved in your export roles request.
The system will import only roles and privileges with a valid validity range.
To import all roles and privileges, make the following API call with the roles and associated privileges (exported before) in the request body.
All valid roles and their privileges in the target environment have been replaced with roles and associated privileges exported from the source environment.
As a precondition to import, first export all roles and associated privileges by making the API call, as shown in the with an empty request body.
We want to import all roles to the target environment and thus we have to use the roles and privileges from the response of the export done before.
https://auth-api.{another-environment}.tuumplatform.com/api/v1/roles/privileges/import
Learn more about the in the Tuum developer portal.
In this example, you can learn how to add specific roles and their privileges to the target Tuum environment.
The role codes we're importing roles and privileges for are: ACCOUNTANT
and TEST_LT
.
In this example, the role ACCOUNTANT
already existed in the target environment, but role TEST_LT
is a new role.
The system will import only roles and associated privileges with a valid validity range.
To import specific roles and associated privileges to the target environment, make the following API call.
Ensure the target environment for the import is different from the export environment.
Below is an example request body of the API call for import roles.
Below you find an example response body to the API call above.
The selected valid roles ACCOUNTANT and TEST_LT with related privileges have been imported.
Here, you can learn how to use APIs to export roles and their privileges from one Tuum environment and import them into another. This functionality aims to facilitate smooth replication for testing across different environments.
Tuum offers three API endpoints for exporting and importing roles and their associated privileges.
We will import specific roles and associated privileges using the data retrieved in the previous .
The roles and privileges combination was obtained from the endpoint.
https://auth-api.target-environment.tuumplatform.com/api/v1/roles/privileges/import
Learn more about the in the Tuum developer portal.
enables you to retrieve all roles or specific roles and their privileges from the source Tuum environment.
allows you to add a selected set of roles and their privileges to the target Tuum environment. Any existing roles and privileges in the target environment not included in the import will remain unchanged.
lets you delete all existing roles and their privileges in the target environment and replace them with new roles and privileges specified in the payload.
The export and import functionality is restricted to users with the EXPORT_IMPORT_ROLE_PRIVILEGES
privilege. Learn how to assign privileges.
In this example, you can learn how to retrieve specific roles and their privileges from the source Tuum environment.
In this example, we will export specific roles and privileges.
The role codes we're exporting roles and privileges for are: ACCOUNTANT
and TEST_LT
.
The system will export only roles and associated privileges with a valid validity range.
To export specific roles and privileges, make the following API call.
Below is an example request body of the API call for export roles.
Below you find an example response body to the API call above.
The selected valid roles ACCOUNTANT and TEST_LT with related privileges have been exported.
https://auth-api.sandbox.tuumplatform.com/api/v1/roles/privileges/export
Learn more about the in the Tuum developer portal.