Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ public boolean isEnabled() {
if (roleService.isEnabled()) {
LOGGER.debug("RoleService is enabled. We will use it instead of StaticRoleBasedAPIAccessChecker.");
}
return roleService.isEnabled();
return !roleService.isEnabled();
}

@Override
public List<String> getApisAllowedToUser(Role role, User user, List<String> apiNames) throws PermissionDeniedException {
if (isEnabled()) {
if (!isEnabled()) {
return apiNames;
}

Expand All @@ -93,7 +93,7 @@ public List<String> getApisAllowedToUser(Role role, User user, List<String> apiN

@Override
public boolean checkAccess(User user, String commandName) throws PermissionDeniedException {
if (isEnabled()) {
if (!isEnabled()) {
return true;
}

Expand All @@ -107,6 +107,10 @@ public boolean checkAccess(User user, String commandName) throws PermissionDenie

@Override
public boolean checkAccess(Account account, String commandName) {
if (!isEnabled()) {
return true;
}

RoleType roleType = accountService.getRoleType(account);
if (isApiAllowed(commandName, roleType)) {
return true;
Expand Down