Skip to content

Commit d8aa0f9

Browse files
committed
Fix compilation
1 parent 552309b commit d8aa0f9

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,17 @@ public Builder add(IndexPrivilege privilege, String... indices) {
256256
return this;
257257
}
258258

259+
// TODO remove me
260+
public Builder add(
261+
FieldPermissions fieldPermissions,
262+
Set<BytesReference> query,
263+
IndexPrivilege privilege,
264+
boolean allowRestrictedIndices,
265+
String... indices
266+
) {
267+
return add(fieldPermissions, query, privilege, allowRestrictedIndices, false, indices);
268+
}
269+
259270
public Builder add(
260271
FieldPermissions fieldPermissions,
261272
Set<BytesReference> query,

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AuthorizedIndicesTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public void testSecurityIndicesAreRestrictedForDefaultRole() {
188188

189189
public void testSecurityIndicesAreNotRemovedFromUnrestrictedRole() {
190190
Role role = Role.builder(RESTRICTED_INDICES, randomAlphaOfLength(8))
191-
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.ALL, true, "*")
191+
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.ALL, true, false, "*")
192192
.cluster(Set.of("all"), Set.of())
193193
.build();
194194
Settings indexSettings = Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, IndexVersion.current()).build();

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RBACEngineTests.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ public void testCheckRestrictedIndexPatternPermission() throws Exception {
781781
randomIntBetween(2, XPackPlugin.ASYNC_RESULTS_INDEX.length() - 2)
782782
);
783783
Role role = Role.builder(RESTRICTED_INDICES, "role")
784-
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.INDEX, false, patternPrefix + "*")
784+
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.INDEX, false, false, patternPrefix + "*")
785785
.build();
786786
RBACAuthorizationInfo authzInfo = new RBACAuthorizationInfo(role, null);
787787

@@ -892,7 +892,7 @@ public void testCheckRestrictedIndexPatternPermission() throws Exception {
892892
);
893893

894894
role = Role.builder(RESTRICTED_INDICES, "role")
895-
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.INDEX, true, patternPrefix + "*")
895+
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.INDEX, true, false, patternPrefix + "*")
896896
.build();
897897
authzInfo = new RBACAuthorizationInfo(role, null);
898898
response = hasPrivileges(
@@ -917,8 +917,8 @@ public void testCheckExplicitRestrictedIndexPermissions() throws Exception {
917917
final boolean restrictedIndexPermission = randomBoolean();
918918
final boolean restrictedMonitorPermission = randomBoolean();
919919
Role role = Role.builder(RESTRICTED_INDICES, "role")
920-
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.INDEX, restrictedIndexPermission, ".sec*")
921-
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.MONITOR, restrictedMonitorPermission, ".security*")
920+
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.INDEX, restrictedIndexPermission, false, ".sec*")
921+
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.MONITOR, restrictedMonitorPermission, false, ".security*")
922922
.build();
923923
RBACAuthorizationInfo authzInfo = new RBACAuthorizationInfo(role, null);
924924

@@ -975,8 +975,8 @@ public void testCheckExplicitRestrictedIndexPermissions() throws Exception {
975975

976976
public void testCheckRestrictedIndexWildcardPermissions() throws Exception {
977977
Role role = Role.builder(RESTRICTED_INDICES, "role")
978-
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.INDEX, false, ".sec*")
979-
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.MONITOR, true, ".security*")
978+
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.INDEX, false, false, ".sec*")
979+
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.MONITOR, true, false, ".security*")
980980
.build();
981981
RBACAuthorizationInfo authzInfo = new RBACAuthorizationInfo(role, null);
982982

@@ -1013,8 +1013,8 @@ public void testCheckRestrictedIndexWildcardPermissions() throws Exception {
10131013
);
10141014

10151015
role = Role.builder(RESTRICTED_INDICES, "role")
1016-
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.INDEX, true, ".sec*")
1017-
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.MONITOR, false, ".security*")
1016+
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.INDEX, true, false, ".sec*")
1017+
.add(FieldPermissions.DEFAULT, null, IndexPrivilege.MONITOR, false, false, ".security*")
10181018
.build();
10191019
authzInfo = new RBACAuthorizationInfo(role, null);
10201020

@@ -1297,6 +1297,7 @@ public void testBuildUserPrivilegeResponse() {
12971297
Collections.singleton(query),
12981298
IndexPrivilege.READ,
12991299
randomBoolean(),
1300+
false,
13001301
"index-4",
13011302
"index-5"
13021303
)
@@ -1912,6 +1913,7 @@ public void testChildSearchActionAuthorizationIsNotSkippedWhenRoleHasDLS() {
19121913
Set.of(query),
19131914
IndexPrivilege.READ,
19141915
randomBoolean(),
1916+
false,
19151917
indices
19161918
)
19171919
.build()

0 commit comments

Comments
 (0)