Updates a list of security groups to which a user belongs.
Use this operation to update existing security group list of a specific user in QAComplete.
To update the whole security group list, use the /depts/{DeptId}/users/{Id}/secuirtygroups (PUT)
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 profile, send a PATCH request to the following URL:
URL parameters
DeptId : integer, required
The ID of the needed department.
UserId : integer, required
The ID of the user profile, whose list of security groups you want to update.
Body parameters
In the request body, pass the RequestUserSecurityGroupPut
JSON object that describes the updated list of security groups:
"Groups": [
{
"ProjId": "int",
"GroupName": "string",
}
]
}
The property values you do not specify are set to their default values.
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:
PATCH 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: 106
{
"Groups": [
{
"ProjId": 12345,
"GroupName": "Security Administrator"
}
]
}
A sample request made by using cURL:
curl -u [email protected]:p@ssword -d @securitygroups.txt -H "Content-Type: application/json" -H "Accept: application/json" http://yourserver.com/service/api/v1/depts/8162/users/24793/securitygroups
Response Format
If successful, the operation responds with HTTP status code 200 and returns a JSON object with the updated user profile.
A sample response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 169
{
"metadata": {
"result_set": {
"count": 1,
"offset": 0,
"limit": 25,
"total": 1
},
"permissions": {
"acl": 7
}
},
"results": [
{
"id": 24793,
"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 changed security groups.
The project’s 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.