Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Resource: User Permissions ( /api/user/{id}/permissions/global )

Global User Permissions resource - allows the retrieval of the collection of global permissions directly associated with a user, or updating the permissions associated with a user.

This resource supports the following methods: GET, PUT

Methods

GET


Retrieves the global permissions for this user

Required Permissions

  • Administration/Organisation/ManageUserAndGroupSecurity

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if the request was completed successfully.
404 - NotFoundReturned if the user does not exist.

Example - Retrieve global permissions

Retrieve the global permissions associated with a user

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}3a31a68a-9e51-4d87-91bb-aca0fa5c1fe9Unique ID of the user to retrieve global permissions for

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

Code Block
languagenone
[
  {
    "Id": "e6a7d6d3-6b16-4e94-a768-54bdd8bb3b22",
    "Key": "/Administration",
    "Links": [
      {
        "Href": "http://localhost/api/permission/e6a7d6d3-6b16-4e94-a768-54bdd8bb3b22",
        "Rel": "Permission"
      }
    ]
  },
  {
    "Id": "fad12035-4937-401a-881a-ea340050218e",
    "Key": "/Resources",
    "Links": [
      {
        "Href": "http://localhost/api/permission/fad12035-4937-401a-881a-ea340050218e",
        "Rel": "Permission"
      }
    ]
  }
]

Status Code

200 - OK

PUT


Sets the global permissions for this user

Required Permissions

  • Administration/Organisation/ManageUserAndGroupSecurity

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if the request was completed successfully.
403 - ForbiddenReturned if one or more permissions could not be resolved.
404 - NotFoundReturned if the user does not exist.

Example - Set global permissions

Set the global permissions for a user (using the unique ID for each permission)

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}3a31a68a-9e51-4d87-91bb-aca0fa5c1fe9Unique ID of the user to retrieve global permissions for

Request Body

Code Block
languagenone
[
  {
    "Key": null,
    "Id": "e6a7d6d3-6b16-4e94-a768-54bdd8bb3b22"
  },
  {
    "Key": null,
    "Id": "fad12035-4937-401a-881a-ea340050218e"
  }
]

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

Code Block
languagenone
[
  {
    "Id": "e6a7d6d3-6b16-4e94-a768-54bdd8bb3b22",
    "Key": "/Administration",
    "Links": [
      {
        "Href": "http://localhost/api/permission/e6a7d6d3-6b16-4e94-a768-54bdd8bb3b22",
        "Rel": "Permission"
      }
    ]
  },
  {
    "Id": "fad12035-4937-401a-881a-ea340050218e",
    "Key": "/Resources",
    "Links": [
      {
        "Href": "http://localhost/api/permission/fad12035-4937-401a-881a-ea340050218e",
        "Rel": "Permission"
      }
    ]
  }
]

Status Code

200 - OK

Example - Set global permissions

Set the global permissions for a user (using the unique Key for each permission)

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}3a31a68a-9e51-4d87-91bb-aca0fa5c1fe9Unique ID of the user to retrieve global permissions for

Request Body

Code Block
languagenone
[
  {
    "Key": "/Administration",
    "Id": null
  },
  {
    "Key": "/Resources",
    "Id": null
  }
]

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

Code Block
languagenone
[
  {
    "Id": "e6a7d6d3-6b16-4e94-a768-54bdd8bb3b22",
    "Key": "/Administration",
    "Links": [
      {
        "Href": "http://localhost/api/permission/e6a7d6d3-6b16-4e94-a768-54bdd8bb3b22",
        "Rel": "Permission"
      }
    ]
  },
  {
    "Id": "fad12035-4937-401a-881a-ea340050218e",
    "Key": "/Resources",
    "Links": [
      {
        "Href": "http://localhost/api/permission/fad12035-4937-401a-881a-ea340050218e",
        "Rel": "Permission"
      }
    ]
  }
]

Status Code

200 - OK