Skip to content

Commit

Permalink
Create a constant
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Nov 21, 2024
1 parent af69183 commit aa50a9a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public class ConfigModelV7 extends ConfigModel {
private RoleMappingHolder roleMappingHolder;
private SecurityDynamicConfiguration<RoleV7> roles;
private SecurityDynamicConfiguration<TenantV7> tenants;
private final static Set<String> ALL_INDICES = Set.of("*");

public ConfigModelV7(
SecurityDynamicConfiguration<RoleV7> roles,
Expand Down Expand Up @@ -1000,12 +1001,12 @@ private static boolean impliesTypePerm(
if (resolved.isLocalAll()) {
indexMatcherAndPermissions = ipatterns.stream()
.filter(indexPattern -> "*".equals(indexPattern.getUnresolvedIndexPattern(user)))
.map(p -> new IndexMatcherAndPermissions(Set.of("*"), p.perms))
.map(p -> new IndexMatcherAndPermissions(ALL_INDICES, p.perms))
.toArray(IndexMatcherAndPermissions[]::new);
} else {
indexMatcherAndPermissions = ipatterns.stream().map(p -> {
if ("*".equals(p.getUnresolvedIndexPattern(user))) {
return new IndexMatcherAndPermissions(Set.of("*"), p.perms);
return new IndexMatcherAndPermissions(ALL_INDICES, p.perms);
}
return new IndexMatcherAndPermissions(p.attemptResolveIndexNames(user, resolver, cs), p.perms);
}).toArray(IndexMatcherAndPermissions[]::new);
Expand Down

0 comments on commit aa50a9a

Please sign in to comment.