Roles
Add a role
Create a business role that users can be given and that permissions can refer to.
Creates a business role. Give it to users with Add or modify a user (roles), and refer to it in access control lists and Data Security.
| Method and path | POST /plugin/datafor-modeler/api/roles/insert |
| Permission | Administrator |
| Content type | application/x-www-form-urlencoded |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
authority |
form | string | Yes | Role name. Must not contain &, \ or /. |
Example
curl -u admin:password -X POST "http://localhost:28080/datafor/plugin/datafor-modeler/api/roles/insert" \
-d "authority=Sales"
{
"success": true,
"code": "200"
}
Errors
code |
When |
|---|---|
"400" |
The name contains &, \ or / (msg: can not contain & \ /). |
"401" |
The caller is not an administrator. |
"500" |
The role could not be stored, for example because it already exists; msg has the database message. |
Related: Get roles, Delete a role