Merge branch 'master' into audit-be-minor-refactoring
This commit is contained in:
commit
24381904b3
1 changed files with 14 additions and 1 deletions
|
@ -51,6 +51,8 @@ import reactor.core.publisher.Mono;
|
|||
@Slf4j
|
||||
public class AccessControlService {
|
||||
|
||||
private static final String ACCESS_DENIED = "Access denied";
|
||||
|
||||
@Nullable
|
||||
private final InMemoryReactiveClientRegistrationRepository clientRegistrationRepository;
|
||||
private final RoleBasedAccessControlProperties properties;
|
||||
|
@ -97,6 +99,17 @@ public class AccessControlService {
|
|||
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 =
|
||||
|
@ -113,7 +126,7 @@ public class AccessControlService {
|
|||
&& isAuditAccessible(context, user);
|
||||
|
||||
if (!accessGranted) {
|
||||
throw new AccessDeniedException("Access denied");
|
||||
throw new AccessDeniedException(ACCESS_DENIED);
|
||||
}
|
||||
})
|
||||
.then();
|
||||
|
|
Loading…
Add table
Reference in a new issue