Skip to content

Commit 596cae9

Browse files
author
seonho-jeong
committed
BE: fix(rbac): address PR review comments
1 parent e5bb106 commit 596cae9

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

api/src/main/java/io/kafbat/ui/config/auth/RoleBasedAccessControlProperties.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ public List<Role> getRoles() {
2727
return roles;
2828
}
2929

30-
public void setDefaultRole(DefaultRole defaultRole) {
31-
this.defaultRole = defaultRole;
32-
}
33-
3430
@Nullable
3531
public DefaultRole getDefaultRole() {
3632
return defaultRole;

api/src/main/java/io/kafbat/ui/service/rbac/AccessControlService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ public void init() {
8787
.flatMap(Set::stream)
8888
.collect(Collectors.toSet());
8989

90-
if (!(properties.getRoles().isEmpty() && properties.getDefaultRole() == null)
90+
boolean hasRolesConfigured = !properties.getRoles().isEmpty() || properties.getDefaultRole() != null;
91+
if (hasRolesConfigured
9192
&& "oauth2".equalsIgnoreCase(environment.getProperty("auth.type"))
9293
&& (clientRegistrationRepository == null || !clientRegistrationRepository.iterator().hasNext())) {
9394
log.error("Roles are configured but no authentication methods are present. Authentication might fail.");

0 commit comments

Comments
 (0)