role create

The role create command creates a new role with the permissions defined in a JSON file.

Usage

role create --r RoleName --f JSONFile
RequiredArgumentDescription
Yes--r RoleNameThe name of the new role.
Yes--f JSONFileThe path to a JSON file containing the definition for the new role.

Role File Format

The easiest way to create a role definition file is to use the role permission export command to generate a file of an existing role, then modify it. In this file, permissions are grouped as they are in the Spectrum Management Console list of permissions. For each secured entity, you can specify the permission for EXECUTE, DELETE, CREATE, MODIFY, and VIEW. The valid values are:
true
Grants the permission.
false
Does not grant the permission.
null
A null value indicates a permission that does not apply to the secured entity.

The following example creates a new role named MyNewRole. This role has permissions for the permission group Matching. The permissions are Open Parser Cultures, Open Parser Domains, and OpenParser Tables.

{
  "name" : "MyNewRole",
  "userNames" : [ ],
  "groups" : [ {
    "name" : "Matching",
    "permissions" : [ {
      "name" : "Open Parser Cultures",
      "permissions" : {
        "EXECUTE" : "",
        "DELETE" : "",
        "CREATE" : "",
        "MODIFY" : "true",
        "VIEW" : "true"
      }
    }, {
      "name" : "Open Parser Domains",
      "permissions" : {
        "EXECUTE" : "",
        "DELETE" : "",
        "CREATE" : "",
        "MODIFY" : "false",
        "VIEW" : "false"
      }
    }, {
      "name" : "OpenParser Tables",
      "permissions" : {
        "EXECUTE" : "",
        "DELETE" : "false",
        "MODIFY" : "false",
        "CREATE" : "false",
        "VIEW" : "false"
      }
    } ]
  } ],
}

Example

This example creates a new role named SalesAnalyst and uses a role definition in the file c:\roles\SalesAnalyst.json.

role create --r SalesAnalyst --f C:\roles\SalesAnalyst.json