Skip to content

Commit 867a525

Browse files
Documentation for permissions verification feature (#11155) (#11176)
1 parent d5f4852 commit 867a525

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

_security/access-control/permissions.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,36 @@ GET _cat/shards?v
5959
}
6060
```
6161

62+
The preceding request runs the actual operation to test permissions. To simulate the check without executing the operation, set the `perform_permission_check` query parameter to `true`:
63+
64+
```json
65+
PUT /my_index/_doc/1?perform_permission_check=true
66+
{
67+
"title": "Test Document"
68+
}
69+
```
70+
{% include copy-curl.html %}
71+
72+
The response indicates whether the user has sufficient permissions to perform the operation and lists any missing privileges. This option is useful for safely testing operations such as `POST`, `PUT`, and `DELETE` but does not apply to the `GET` operation.
73+
74+
When the user has sufficient permissions, the response appears similar to the following:
75+
76+
```json
77+
{
78+
"accessAllowed": true,
79+
"missingPrivileges": []
80+
}
81+
```
82+
83+
When the user does not have sufficient permissions, the response lists the missing privileges:
84+
85+
```json
86+
{
87+
"accessAllowed": false,
88+
"missingPrivileges": ["indices:data/write/index"]
89+
}
90+
```
91+
6292
[Create a user and a role]({{site.url}}{{site.baseurl}}/security/access-control/users-roles/), map the role to the user, and start sending signed requests using curl, Postman, or any other client. Then gradually add permissions to the role as you encounter errors. Even after you resolve one permissions error, the same request might generate new errors; the plugin only returns the first error it encounters, so keep trying until the request succeeds.
6393

6494
Rather than individual permissions, you can often achieve your desired security posture using a combination of the default action groups. See [Default action groups]({{site.url}}{{site.baseurl}}/security/access-control/default-action-groups/) for descriptions of the permissions that each group grants.

0 commit comments

Comments
 (0)