Import selected roles
In this example, you can learn how to add specific roles and their privileges to the target Tuum environment.
Use case
We will import specific roles and associated privileges using the data retrieved in the previous export selected roles example.
The role codes we're importing roles and privileges for are: ACCOUNTANT
and TEST_LT
.
The roles and privileges combination was obtained from the Export selected roles endpoint.
In this example, the role ACCOUNTANT
already existed in the target environment, but role TEST_LT
is a new role.
rolesWithPrivileges": [
{
"roleCode": "ACCOUNTANT",
"privilegeNames": [
"ADD_PERSON",
"APPROVE_APPLICATIONS",
"DISBURSE_LOAN",
"EDIT_CONTRACT",
"EDIT_LOAN_PRODUCTS",
"EDIT_PERSON",
"MANAGE_USERS",
"SEARCH_CONTRACT_DOCUMENTS",
"VIEW_GL_JOURNAL",
"VIEW_LOAN_CONTRACT",
"VIEW_LOAN_PRODUCTS",
"VIEW_PERSON",
"VIEW_PERSON_ADDITIONAL_CONTACT",
"VIEW_PERSON_GROUP_TYPE"
],
"valid": true
},
{
"roleCode": "TEST_LT",
"privilegeNames": [
"MANAGE_USERS",
"READ_RESTRICTED_DATA",
"VIEW_EXTERNAL_CONTRACTS",
"VIEW_FOUREYE_REVIEW_RULE",
"VIEW_PERSON",
"VIEW_PERSON_GROUP_TYPE",
"VIEW_REVIEW_APPROVALS_CONFIGURATION"
],
"valid": true
}
The system will import only roles and associated privileges with a valid validity range.
Sample API call
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.
https://auth-api.target-environment.tuumplatform.com/api/v1/roles/privileges/import
Sample request
Below is an example request body of the API call for import roles.
{
"rolesWithPrivileges": [
{
"roleCode": "ACCOUNTANT",
"privilegeNames": [
"ADD_PERSON",
"APPROVE_APPLICATIONS",
"DISBURSE_LOAN",
"EDIT_CONTRACT",
"EDIT_LOAN_PRODUCTS",
"EDIT_PERSON",
"MANAGE_USERS",
"SEARCH_CONTRACT_DOCUMENTS",
"VIEW_GL_JOURNAL",
"VIEW_LOAN_CONTRACT",
"VIEW_LOAN_PRODUCTS",
"VIEW_PERSON",
"VIEW_EXTERNAL_CONTRACTS",
"VIEW_PERSON_GROUP_TYPE",
],
"valid": true
},
{
"roleCode": "TEST_LT",
"privilegeNames": [
"MANAGE_USERS",
"READ_RESTRICTED_DATA",
"Test_LT",
"VIEW_FOUREYE_REVIEW_RULE",
"VIEW_REVIEW_APPROVALS_CONFIGURATION",
"VIEW_PERSON",
"VIEW_EXTERNAL_CONTRACTS",
"VIEW_PERSON_GROUP_TYPE",
],
"valid": true
}
]
}
Sample response
Below you find an example response body to the API call above.
Result
The selected valid roles ACCOUNTANT and TEST_LT with related privileges have been imported.
Last updated
Was this helpful?