Add Role to User
Overview
This operation assigns one or more existing roles to one or more users.
ACL Authorization Flow
The user making this request must be assigned with admin or spatial-admin roles.
HTTP PUT URL Format
The following format is used for HTTP PUT request:
PUT DATA: { "users": ["user1", "user2"], "roles": ["role1", "role2"] } PUT HEADER: Content-Type:application/json
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
users | String | Yes | Specifies a list of users. |
roles | String | Yes | Specifies a list of roles. |
Returns
Assigns specified role(s) to specified user(s).
Example for PUT
The following request assigns “spatial-user” and “spatial-sub-admin” roles to both “user1” and “user2”
Request URL
http://<server>:<port>/rest/Spatial/AccessControlService/roles/users
Request Body
{ "users": ["user1", "user2"], "roles": ["spatial-user", "spatial-sub-admin"] }
Response
200 OK
Note: It returns only 200 OK if the role(s) was assigned to the user(s). The newly added
role gets added to the roles the user already may have. Only existing roles and
users must be provided in the request.