Skip to content

Commit 4f51d2b

Browse files
committed
More
1 parent 9275a69 commit 4f51d2b

File tree

4 files changed

+9
-18
lines changed

4 files changed

+9
-18
lines changed

docs/reference/rest-api/security/get-user-privileges.asciidoc

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
For the most up-to-date API details, refer to {api-es}/group/endpoint-security[Security APIs].
1212
--
1313

14-
Retrieves the <<security-privileges,security privileges>> for the logged in
14+
Retrieves the <<security-privileges,security privileges>> for the logged in
1515
user.
1616

1717
[[security-api-get-user-privileges-request]]
@@ -22,7 +22,7 @@ user.
2222
[[security-api-get-user-privileges-prereqs]]
2323
==== {api-prereq-title}
2424

25-
* All users can use this API, but only to determine their own privileges. To
25+
* All users can use this API, but only to determine their own privileges. To
2626
check the privileges of other users, you must use the run as feature. For
2727
more information, see <<run-as-privilege>>.
2828

@@ -57,15 +57,6 @@ GET /_security/user/_privileges
5757
"all"
5858
],
5959
"allow_restricted_indices" : true
60-
},
61-
{
62-
"names" : [
63-
"*::failures"
64-
],
65-
"privileges" : [
66-
"all"
67-
],
68-
"allow_restricted_indices" : true
6960
}
7061
],
7162
"applications" : [

server/src/main/java/org/elasticsearch/cluster/metadata/IndexAbstraction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ default boolean isDataStreamRelated() {
100100
return false;
101101
}
102102

103-
default boolean isDataStreamConcreteFailureIndex() {
103+
default boolean isConcreteFailureIndexOfDataStream() {
104104
return false;
105105
}
106106

@@ -198,7 +198,7 @@ public boolean isSystem() {
198198
}
199199

200200
@Override
201-
public boolean isDataStreamConcreteFailureIndex() {
201+
public boolean isConcreteFailureIndexOfDataStream() {
202202
return getParentDataStream() != null && getParentDataStream().isFailureStoreIndex(getName());
203203
}
204204

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,10 @@ public boolean checkIndex(Group group) {
463463
if (ds != null) {
464464
if (group.checkIndex(ds.getName())) {
465465
// TODO is this right?
466-
if (indexAbstraction.isDataStreamConcreteFailureIndex()) {
467-
return group.checkSelector(IndexComponentSelector.FAILURES);
468-
}
469-
return group.checkSelector(selector);
466+
final IndexComponentSelector selectorToCheck = indexAbstraction.isConcreteFailureIndexOfDataStream()
467+
? IndexComponentSelector.FAILURES
468+
: selector;
469+
return group.checkSelector(selectorToCheck);
470470
}
471471
}
472472
if (indexAbstraction != null && indexAbstraction.getType() == IndexAbstraction.Type.DATA_STREAM) {

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/RBACEngine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ static AuthorizedIndices resolveAuthorizedIndicesFromRole(
878878
if (includeDataStreams) {
879879
for (IndexAbstraction indexAbstraction : lookup.values()) {
880880
// TODO this is not great ...
881-
if ((indexAbstraction.isDataStreamConcreteFailureIndex()
881+
if ((indexAbstraction.isConcreteFailureIndexOfDataStream()
882882
&& predicate.test(indexAbstraction.getParentDataStream(), IndexComponentSelector.FAILURES.getKey()))
883883
|| predicate.test(indexAbstraction, selector)) {
884884
indicesAndAliases.add(indexAbstraction.getName());

0 commit comments

Comments
 (0)