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 @@ -51,6 +51,8 @@
@Slf4j
public class AccessControlService {

private static final String ACCESS_DENIED = "Access denied";

@Nullable
private final InMemoryReactiveClientRegistrationRepository clientRegistrationRepository;
private final RoleBasedAccessControlProperties properties;
Expand Down Expand Up @@ -97,6 +99,17 @@ public Mono<Void> validateAccess(AccessContext context) {
return Mono.empty();
}

if (CollectionUtils.isNotEmpty(context.getApplicationConfigActions())) {
return getUser()
.doOnNext(user -> {
boolean accessGranted = isApplicationConfigAccessible(context, user);

if (!accessGranted) {
throw new AccessDeniedException(ACCESS_DENIED);
}
}).then();
}

return getUser()
.doOnNext(user -> {
boolean accessGranted =
Expand All @@ -113,7 +126,7 @@ && isAclAccessible(context, user)
&& isAuditAccessible(context, user);

if (!accessGranted) {
throw new AccessDeniedException("Access denied");
throw new AccessDeniedException(ACCESS_DENIED);
}
})
.then();
Expand Down