PUT/depts/{DeptId}/users/{Id}/securitygroups

Applies to QAComplete 14.5, last modified on August 06, 2024

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:

http://{server}/rest-api/service/api/v1/depts/{DeptId}/users/{Id}/secuirtygroups
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.

See Also

Security Groups REST API Reference

Highlight search results