Map users to roles
You can map users to roles in two ways.
-
Custom database query
-
Fixed value
Custom Database Query
- In Admin Console, on the Documents Tree, click Authentication.
-
Select
HTTP Request and
External database.
Use this option to configure user roles from a custom query to an external database.
- In Admin Console, right-click Roles and click New user role. Name the new role and click OK.
-
On the
External DB mapping
tab,
Source field, enter the
database connection string. In the area below the
Source field, enter the
SQL query.
< and > characters for numeric values, and within '< and >' for strings.Within the SQL statement, each URL property should be placed within
Any parameters from HTTP request string can be used within a query.
- Example
-
Select *from Roles_Mapping
where Staff_ID='<UserID>' and Group_ID = 'Role'
Where:
Staff_ID and Group_ID are fields of Roles_Mapping table.
UserID is a parameter from an HTTP request.
'Role' is an identifier/name of a particular role.
If the query returns at least one value, the user will get the rights of the selected role.
Fixed Values
- In Admin Console, on the Documents Tree, click Authentication.
-
Select
HTTP Request and
Fixed values.
In this case, the parameters sent via HTTP request are compared to a fixed value.
- In the Admin Console, right-click Roles, and click New user role. Name the new role and click OK.
-
In the
Fixed values mapping
tab, define the property that needs to be compared.
- Select Click here to add new data.
-
Add the property to compare, such as
UserID.
This parameter is passed in the URL.
- For the Operator, select Equal from the list, and add the fixed value.