Updates a list of security groups to which a user belongs.
Use this operation to replace a list of security groups, to which a user belongs, with a new list.
To update an existing list of security groups of the specific user, use the /depts/{DeptId}/users/{Id}/securitygroups (PATCH)
operation.
Authentication
Basic authentication using a user’s login and password. See Authentication for details.
Security Rights
The authenticating user must have administrator privileges.
Request Format
To update the user security group list, send a PUT request to the following URL:
URL parameters
DeptId : integer, required
The ID of the needed department.
Id : integer, required
The ID of the user whose security groups you want to update.
Body parameters
In the request body, pass the RequestUserSecurityGroupPut
JSON object that describes the user’s new security groups:
"Groups": [
{
"ProjId": "int",
"GroupName": "string",
}
]
}
RequestUserSecurityGroupPut : array of objects, required
An array of Group
objects that describe security groups:
"ProjId": "string",
"GroupName": "string"
}
ProjId : integer, required
The unique identifier of the project, with which the user will work under privileges specified by a security group.
GroupName : string, required
The name of the security group the user will be added to.
A sample request:
PUT http://yourserver.com/rest-api/service/api/v1/depts/8162/users/24793/securitygroups HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Content-Type: application/json
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
Content-Length: 116
{
"Groups": [
{
"ProjId": 12345,
"GroupName": "Security Administrator"
}
]
}
A sample request made by using cURL:
curl -u [email protected]:p@ssword -d @user.txt -H "Content-Type: application/json" -H "Accept: application/json" http://yourserver.com/service/api/v1/depts/8162/users/24793/secuirtygroups
Response Format
If successful, the operation responds with HTTP status code 200 and returns a JSON object with the updated user information.
A sample response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 177
{
"metadata": {
"result_set": {
"count": 1,
"offset": 0,
"limit": 25,
"total": 1
},
"permissions": {
"acl": 7
}
},
"results": [
{
"project_Id": 11873,
"name": "Security Administrator"
}
]
}
Error responses
If the operation fails, it returns the appropriate status code and (optionally) the error description in the response body.
Metadata about the security group list.
Pagination information about the security group list. (See Paging Through Results Using Offset and Limit.)
The number of returned security groups.
The offset of the first security group requested.
The maximum number of security groups requested.
The total number of security groups.
The authenticating user’s rights to access security groups.
Access rights:
- 0 - None
- 1 - Read
- 2 - Update
- 3 - Read and update
- 4 - Delete
- 5 - Read and delete
- 7 - Full access
An array of new security groups.
The department ID.
The department name.
The project name.
The unique identifier of the project.
The name of the security group that specifies privileges under which the user will work with the specified project.