Improve documentation of REST endpoint /accounts/self/capabilities

Commit e016933846 added an REST endpoint
for querying the global capabilities of the calling user. Not all
features of this endpoint that were described in the commit message
were contained in the REST API documentation.

Change-Id: I5221b2f180b9deda69a5beec0bacf5033e7bd511
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin 2012-07-18 15:02:01 +02:00
parent 05d942c324
commit 691b9b14d7
2 changed files with 31 additions and 2 deletions

View File

@ -124,6 +124,16 @@ project:: Project path in Gerrit.
refName:: Ref name within project.
[[queryLimit]]
queryLimit
----------
Information about the link:access-control.html#capability_queryLimit[queryLimit]
of a user.
min:: lower limit
max:: upper limit
SEE ALSO
--------

View File

@ -58,8 +58,8 @@ Endpoints
[[accounts_self_capabilities]]
/accounts/self/capabilities (Account Capabilities)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns the global capabilities (such as createProject or
createGroup) that are enabled for the calling user. This can be used
Returns the global capabilities (such as `createProject` or
`createGroup`) that are enabled for the calling user. This can be used
by UI tools to discover if administrative features are available
to the caller, so they can hide (or show) relevant UI actions.
@ -99,6 +99,25 @@ Administrator that has authenticated with digest authentication:
}
----
To filter the set of global capabilities the `q` parameter can be used.
Filtering may decrease the response time by avoiding looking at every
possible alternative for the caller.
----
GET /a/accounts/self/capabilities?format=JSON&q=createAccount&q=createGroup HTTP/1.0
Authorization: Digest username="admin", realm="Gerrit Code Review", nonce="...
)]}'
{
"createAccount": true,
"createGroup": true
}
----
Most results are boolean, and a field is only present when its value
is `true`. link:json.html#queryLimit[`queryLimit`] is a range and is
presented as a nested JSON object with `min` and `max` members.
[[projects]]
/projects/ (List Projects)
~~~~~~~~~~~~~~~~~~~~~~~~~~