-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCS] Add docs for Application Privileges (#32635)
- Loading branch information
Showing
13 changed files
with
495 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
x-pack/docs/en/rest-api/security/create-role-mappings.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
x-pack/docs/en/rest-api/security/delete-app-privileges.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
[role="xpack"] | ||
[[security-api-delete-privilege]] | ||
=== Delete application privileges API | ||
|
||
Removes | ||
{stack-ov}/security-privileges.html#application-privileges[application privileges]. | ||
|
||
==== Request | ||
|
||
`DELETE /_xpack/security/privilege/<application>/<privilege>` | ||
|
||
//==== Description | ||
|
||
==== Path Parameters | ||
|
||
`application` (required):: | ||
(string) The name of the application. Application privileges are always | ||
associated with exactly one application. | ||
|
||
`privilege` (required):: | ||
(string) The name of the privilege. | ||
|
||
// ==== Request Body | ||
|
||
==== Authorization | ||
|
||
To use this API, you must have either: | ||
|
||
- the `manage_security` cluster privilege (or a greater privilege such as `all`); _or_ | ||
- the _"Manage Application Privileges"_ global privilege for the application being referenced | ||
in the request | ||
|
||
==== Examples | ||
|
||
The following example deletes the `read` application privilege from the | ||
`myapp` application: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
DELETE /_xpack/security/privilege/myapp/read | ||
-------------------------------------------------- | ||
// CONSOLE | ||
// TEST[setup:app0102_privileges] | ||
|
||
If the role is successfully deleted, the request returns `{"found": true}`. | ||
Otherwise, `found` is set to false. | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
{ | ||
"myapp": { | ||
"read": { | ||
"found" : true | ||
} | ||
} | ||
} | ||
-------------------------------------------------- | ||
// TESTRESPONSE | ||
|
94 changes: 94 additions & 0 deletions
94
x-pack/docs/en/rest-api/security/get-app-privileges.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
[role="xpack"] | ||
[[security-api-get-privileges]] | ||
=== Get application privileges API | ||
|
||
Retrieves | ||
{stack-ov}/security-privileges.html#application-privileges[application privileges]. | ||
|
||
==== Request | ||
|
||
`GET /_xpack/security/privilege` + | ||
|
||
`GET /_xpack/security/privilege/<application>` + | ||
|
||
`GET /_xpack/security/privilege/<application>/<privilege>` | ||
|
||
|
||
==== Description | ||
|
||
To check a user's application privileges, use the | ||
<<security-api-has-privileges,has privileges API>>. | ||
|
||
|
||
==== Path Parameters | ||
|
||
`application`:: | ||
(string) The name of the application. Application privileges are always | ||
associated with exactly one application. | ||
If you do not specify this parameter, the API returns information about all | ||
privileges for all applications. | ||
|
||
`privilege`:: | ||
(string) The name of the privilege. If you do not specify this parameter, the | ||
API returns information about all privileges for the requested application. | ||
|
||
//==== Request Body | ||
|
||
==== Authorization | ||
|
||
To use this API, you must have either: | ||
|
||
- the `manage_security` cluster privilege (or a greater privilege such as `all`); _or_ | ||
- the _"Manage Application Privileges"_ global privilege for the application being referenced | ||
in the request | ||
|
||
==== Examples | ||
|
||
The following example retrieves information about the `read` privilege for the | ||
`app01` application: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
GET /_xpack/security/privilege/myapp/read | ||
-------------------------------------------------- | ||
// CONSOLE | ||
// TEST[setup:app0102_privileges] | ||
|
||
A successful call returns an object keyed by application name and privilege | ||
name. If the privilege is not defined, the request responds with a 404 status. | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
{ | ||
"myapp": { | ||
"read": { | ||
"application": "myapp", | ||
"name": "read", | ||
"actions": [ | ||
"data:read/*", | ||
"action:login" | ||
], | ||
"metadata": { | ||
"description": "Read access to myapp" | ||
} | ||
} | ||
} | ||
} | ||
-------------------------------------------------- | ||
// TESTRESPONSE | ||
|
||
To retrieve all privileges for an application, omit the privilege name: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
GET /_xpack/security/privilege/myapp/ | ||
-------------------------------------------------- | ||
// CONSOLE | ||
|
||
To retrieve every privilege, omit both the application and privilege names: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
GET /_xpack/security/privilege/ | ||
-------------------------------------------------- | ||
// CONSOLE |
Oops, something went wrong.