File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/rbac Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 51
51
@ Slf4j
52
52
public class AccessControlService {
53
53
54
+ private static final String ACCESS_DENIED = "Access denied" ;
55
+
54
56
@ Nullable
55
57
private final InMemoryReactiveClientRegistrationRepository clientRegistrationRepository ;
56
58
private final RoleBasedAccessControlProperties properties ;
@@ -97,6 +99,17 @@ public Mono<Void> validateAccess(AccessContext context) {
97
99
return Mono .empty ();
98
100
}
99
101
102
+ if (CollectionUtils .isNotEmpty (context .getApplicationConfigActions ())) {
103
+ return getUser ()
104
+ .doOnNext (user -> {
105
+ boolean accessGranted = isApplicationConfigAccessible (context , user );
106
+
107
+ if (!accessGranted ) {
108
+ throw new AccessDeniedException (ACCESS_DENIED );
109
+ }
110
+ }).then ();
111
+ }
112
+
100
113
return getUser ()
101
114
.doOnNext (user -> {
102
115
boolean accessGranted =
@@ -113,7 +126,7 @@ && isAclAccessible(context, user)
113
126
&& isAuditAccessible (context , user );
114
127
115
128
if (!accessGranted ) {
116
- throw new AccessDeniedException ("Access denied" );
129
+ throw new AccessDeniedException (ACCESS_DENIED );
117
130
}
118
131
})
119
132
.then ();
You can’t perform that action at this time.
0 commit comments