Skip to content

Commit

Permalink
Addesed last 2 comments
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Pleskach <ples@aiven.io>
  • Loading branch information
willyborankin committed Oct 4, 2023
1 parent ef0a327 commit 8281a1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ boolean accessHandler(final RestRequest request) {
switch (request.method()) {
case PATCH:
case PUT:
if (!allowPutOrPatch && !restApiAdminEnabled) {
return false;
} else if (allowPutOrPatch && !restApiAdminEnabled) {
return true;
if (!restApiAdminEnabled) {
return allowPutOrPatch;
} else {
return securityApiDependencies.restApiAdminPrivilegesEvaluator()
.isCurrentUserAdminFor(endpoint, SECURITY_CONFIG_UPDATE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public void hasExplicitClusterPermissionPermissionForRestAdminWitFullAccess() {

@Test
public void hasExplicitClusterPermissionPermissionForRestAdmin() {
// verify all endpoint except SSL
// verify all endpoint except SSL and verify CONFIG endpoints
final Collection<Endpoint> noSslEndpoints = ENDPOINTS_WITH_PERMISSIONS.keySet()
.stream()
.filter(e -> e != Endpoint.SSL && e != Endpoint.CONFIG)
Expand Down

0 comments on commit 8281a1b

Please sign in to comment.