Dela via


Permissions - Has Permissions

Evaluates whether the caller has the specified permissions on the specified set of security tokens.

GET https://dev.azure.com/{organization}/_apis/permissions/{securityNamespaceId}/{permissions}?api-version=7.1
GET https://dev.azure.com/{organization}/_apis/permissions/{securityNamespaceId}/{permissions}?tokens={tokens}&alwaysAllowAdministrators={alwaysAllowAdministrators}&delimiter={delimiter}&api-version=7.1

URI Parameters

Name In Required Type Description
securityNamespaceId
path True

string

uuid

Security namespace identifier.

organization
path

string

The name of the Azure DevOps organization.

permissions
path

integer

int32

Permissions to evaluate.

api-version
query True

string

Version of the API to use. This should be set to '7.1' to use this version of the api.

alwaysAllowAdministrators
query

boolean

If true and if the caller is an administrator, always return true.

delimiter
query

string

Optional security token separator. Defaults to ",".

tokens
query

string

One or more security tokens to evaluate.

Responses

Name Type Description
200 OK

boolean[]

successful operation

Security

accessToken

Personal access token. Use any value for the user name and the token as the password.

Type: basic

Examples

A list of tokens
Singular token

A list of tokens

Sample request

GET https://dev.azure.com/fabrikam/_apis/permissions/5a27515b-ccd7-42c9-84f1-54c998f03866?tokens=token1,token2,token3&alwaysAllowAdministrators=False&api-version=7.1

Sample response

{
  "count": 3,
  "value": [
    false,
    false,
    true
  ]
}

Singular token

Sample request

GET https://dev.azure.com/fabrikam/_apis/permissions/5a27515b-ccd7-42c9-84f1-54c998f03866?alwaysAllowAdministrators=False&api-version=7.1

Sample response