role.create

The role.create command creates a new role.

Requires Org-Admin rights.

TR50 Request


                        {
  "cmd": {
    "command": "role.create",
    "params": {
      "key": "myrolekey",
      "name": "My New Role",
      "desc": "The description for the new role",
      "perms": ["thing", "property", "thing_def.list", "thing_def.find"],
      "viewTags": ["tag1", "tag2"],
      "updateTags": ["tag1"]
    }
  }
}
      

Request Parameters

Name

Type

Required

Description

key

String

Yes

The key of the role.

name

String

Yes

The name of the role.

desc

String

 

The description.

perms

Array

Yes

An array structure containing services and service methods that the role can execute.

viewTags

Array

 

The security tags for things that the user can only view.

updateTags

Array

 

The security tags for things that the user can update.

TR50 Response

If the command is sent successfully a success message and the object id of the role is returned. Otherwise, an error and error message will be returned.


                        {
  "cmd": {
    "success": true,
    "params": {
      "id": "500000000000000000000001"
    }
  }
}
      

Response Parameters

Name

Type

Description

id

String

The object id of the role.