Creating users, groups and roles by using REST API
You can use REST API to create users, groups and roles in the Decision Center database.
In the Decision Center REST API, you can define users, groups and roles in an XML document, and then apply the document.
You use the following REST API endpoints:
- GET /<version>/repository/users-roles-registry: Retrieves the last uploaded XML file for users, groups and roles. If no file has been previously uploaded, none can be retrieved.
- POST /<version>/repository/users-roles-registry: Sets the configuration for users, groups and roles.
Defining users, groups and roles
To use the endpoints:
- Open your Decision Center REST API.
- Open the Admin section.
- Run GET /<version>/repository/users-roles-registry to retrieve the last uploaded XML file, if any.
- Update the XML file or create a new one if necessary.
- Run POST /<version>/repository/users-roles-registry to apply the XML file.
After posting the XML file, you can check the changes in the Administration tab of the Business console.
Note: You do not have to define the following standard roles because they are set by default in
Decision Center: rtsUser,
rtsAdministrator, rtsConfigManager, and rtsInstaller.
Format of the XML file
The file contains information between two tags:
<dc-usermanagement></dc-usermanagement>
You define roles with the tag role:
<role name="role1"/>
You define groups with roles and the tag group:
<group name="group1" roles="role1,role2,role3"/>
You define a user in a group with the tag user:
<user name="user1" groups="group1,group2"/>
The following example shows the tags in XML:
<dc-usermanagement>
<role name="mycompany_insurancerules_admin" />
<role name="mycompany_home_insurance_PM" />
<role name="mycompany_car_insurance_PM" />
<role name="mycompany_rule_experts" />
<role name="Eligibility" />
<role name="Validator" />
<role name="ruleViewer" />
<role name="ruleEditor" />
<group name="rtsUser" roles="rtsUser"/>
<group name="rtsAdministrator" roles="rtsAdministrator"/>
<group name="rtsConfigManager" roles="rtsConfigManager"/>
<group name="rtsInstaller" roles="rtsInstaller"/>
<group name="mycompany_insurancerules_admin" roles="mycompany_insurancerules_admin"/>
<group name="mycompany_home_insurance_PM" roles="mycompany_home_insurance_PM"/>
<group name="mycompany_car_insurance_PM" roles="mycompany_car_insurance_PM"/>
<group name="mycompany_rule_experts" roles="mycompany_rule_experts"/>
<group name="Eligibility" roles="Eligibility"/>
<group name="Validator" roles="Validator"/>
<group name="ruleViewer" roles="ruleViewer"/>
<group name="ruleEditor" roles="ruleEditor"/>
<user name="rtsAdmin" groups="rtsAdministrator"/>
<user name="rtsAdmin1" groups="rtsAdministrator"/>
<user name="rtsAdmin2" groups="rtsAdministrator"/>
<user name="rtsConfig" groups="rtsConfigManager"/>
<user name="rtsUser1" groups="rtsUser"/>
<user name="rtsUser2" groups="rtsUser"/>
<user name="rtsUser3" groups="rtsUser"/>
<user name="rtsUser4" groups="rtsUser"/>
<user name="rtsUser5" groups="rtsUser"/>
<user name="rtsUser6" groups="rtsUser"/>
<user name="Eli" groups="rtsUser, Eligibility"/>
<user name="Val" groups="rtsUser, Eligibility, Validator"/>
<user name="joe" groups="rtsUser, mycompany_car_insurance_PM, ruleViewer"/>
<user name="jack" groups="rtsUser, mycompany_home_insurance_PM, ruleEditor"/>
<user name="averell" groups="rtsUser, Eligibility"/>
<user name="william" groups="rtsUser, mycompany_insurancerules_admin"/>
<user name="billy" groups="rtsUser, mycompany_car_insurance_PM, mycompany_home_insurance_PM, mycompany_rule_experts"/>
<user name="phil" groups="rtsUser, mycompany_rule_experts"/>
<user name="Paul" groups="rtsUser"/>
<user name="Bea" groups="rtsUser"/>
<user name="Abu" groups="rtsUser"/>
</dc-usermanagement>