linkRolesWithAccounts

 

The "linkRolesWithAccounts" action adds or removes accounts to or from roles.

Important Changing role-based privileges does not affect open data files because their privileges are cached. When you are done modifying privileges, you must run the "applyPrivileges" action to apply your changes to open data files. 

 

Request examples

Minimal

{
  "action": "linkRolesWithAccounts",
  "params": {
    "add": [
      {
        "roleNames": [
          "mquser"
        ],
        "usernames": [
          "account2"
        ]
      }
    ],
    "remove": [
      {
        "roleNames": [
          "role2"
        ],
        "usernames": [
          "account2"
        ]
      }
    ]
  },
  "authToken": "",
  "requestId": ""
}
 
 

 

Response examples

Minimal

{
  "authToken": "",
  "requestId": "",
  "errorCode": 0,
  "errorMessage": ""
}
 
 

 

Properties

Request properties ("params")

Property Description Default Type Limits (inclusive)

add

The "add" property specifies which roles will be added to which accounts. You can specify the roles you want to add with the "rolenames" property and the accounts that will be assigned those roles with the "usernames" property.

Optional with default of {} array of objects

"rolenames"

"usernames"

add

.roleNames

The "roleNames" property specifies the roles to be added to or deleted from the accounts specified by the "usernames" property. This property can specify one or more roles, each between 1 and 64 bytes. Optional with default of [] array 1 or more strings, each between 1 and 30 bytes.

add

.usernames

The "usernames" property specifies the names of the accounts that the action will target. Optional with default of [] array 0 or more usernames, each between 1 and 64 bytes.

remove

The "remove" property specifies which roles will be removed from which accounts. You can specify the roles you want to remove with the "rolenames" property and the accounts to remove them from with the "usernames" property.

Optional with default of {} array of objects

"rolenames"

"usernames"

remove

.roleNames

The "roleNames" property specifies the roles to be added to or deleted from the accounts specified by the "usernames" property. This property can specify one or more roles, each between 1 and 64 bytes. Optional with default of [] array 1 or more strings, each between 1 and 30 bytes.

remove

.usernames

The "usernames" property specifies the names of the accounts that the action will target. Optional with default of [] array 0 or more usernames, each between 1 and 64 bytes.