|
13 | 13 | import org.elasticsearch.action.support.SubscribableListener; |
14 | 14 | import org.elasticsearch.cluster.metadata.IndexAbstraction; |
15 | 15 | import org.elasticsearch.cluster.metadata.ProjectMetadata; |
| 16 | +import org.elasticsearch.core.Nullable; |
16 | 17 | import org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesResponse; |
17 | 18 | import org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesResponse.Indices; |
18 | 19 | import org.elasticsearch.xpack.core.security.authc.Authentication; |
|
35 | 36 | import java.util.Arrays; |
36 | 37 | import java.util.Collection; |
37 | 38 | import java.util.Collections; |
38 | | -import java.util.function.Supplier; |
39 | 39 | import java.util.HashMap; |
40 | 40 | import java.util.LinkedHashMap; |
41 | 41 | import java.util.List; |
@@ -119,19 +119,19 @@ public void loadAuthorizedIndices( |
119 | 119 | ) { |
120 | 120 | if (isSuperuser(requestInfo.getAuthentication().getEffectiveSubject().getUser())) { |
121 | 121 | listener.onResponse(new AuthorizedIndices() { |
122 | | - public Supplier<Set<String>> all() { |
| 122 | + public Set<String> all(@Nullable String selector) { |
123 | 123 | return () -> indicesLookup.keySet(); |
124 | 124 | } |
125 | | - public boolean check(String name) { |
| 125 | + public boolean check(String name, @Nullable String selector) { |
126 | 126 | return indicesLookup.containsKey(name); |
127 | 127 | } |
128 | 128 | }); |
129 | 129 | } else { |
130 | 130 | listener.onResponse(new AuthorizedIndices() { |
131 | | - public Supplier<Set<String>> all() { |
| 131 | + public Set<String> all(@Nullable String selector) { |
132 | 132 | return () -> Set.of(); |
133 | 133 | } |
134 | | - public boolean check(String name) { |
| 134 | + public boolean check(String name, @Nullable String selector) { |
135 | 135 | return false; |
136 | 136 | } |
137 | 137 | }); |
|
0 commit comments