Skip to main content

CreateRole

Create a new role.

Parameters

  • name: role's name.
  • [optional] objects: permisions for objects.
  • [optional] indexes: permisions for indexes.
  • [optional] access_control: permisions for access_control.

Details

By default, no permissions are granted for a role. Permissions must be explicitly granted.

If a role with the same name already exist, an error is returned.

Examples

Add a "researcher" role using CreateRole command:


[{
"CreateRole": {
"name": "researcher",
"objects": {
"create": true,
"read": true,
"update": false,
"delete": false
},
"indexes": {
"create": false,
"read": false,
"update": false,
"delete": false
},
"access_control": {
"create": false,
"read": false,
"update": false,
"delete": false
}
}
}]

Result of successful command:


[{
"CreateRole": {
"status": 0
}
}]

Add a "architect" role using CreateRole command:


[{
"CreateRole": {
"name": "architect",
"objects": {
"create": true,
"read": true,
"update": false,
"delete": false
},
"indexes": {
"create": true,
"read": true,
"update": true,
"delete": true
},
"access_control": {
"create": false,
"read": true,
"update": false,
"delete": false
}
}
}]

Result of successful command:


[{
"CreateRole": {
"status": 0
}
}]