diff --git a/api/src/main/java/io/kafbat/ui/model/rbac/Role.java b/api/src/main/java/io/kafbat/ui/model/rbac/Role.java index a41e39d19..db97d7649 100644 --- a/api/src/main/java/io/kafbat/ui/model/rbac/Role.java +++ b/api/src/main/java/io/kafbat/ui/model/rbac/Role.java @@ -1,5 +1,6 @@ package io.kafbat.ui.model.rbac; +import com.google.common.base.Preconditions; import java.util.List; import lombok.Data; @@ -12,6 +13,7 @@ public class Role { List permissions; public void validate() { + Preconditions.checkArgument(!clusters.isEmpty(), "Role clusters cannot be empty"); permissions.forEach(Permission::transform); permissions.forEach(Permission::validate); }