|
|
@@ -31,7 +31,7 @@ public class AuthorizationManager implements ReactiveAuthorizationManager<Author
|
|
|
private PathRolesMap pathRolesMap;
|
|
|
|
|
|
@Resource
|
|
|
- private UrlAuthorizationDecision urlAuthorizationDecision;
|
|
|
+ private WhiteListChecker whiteListChecker;
|
|
|
|
|
|
@Override
|
|
|
public Mono<AuthorizationDecision> check(Mono<Authentication> mono, AuthorizationContext authorizationContext) {
|
|
|
@@ -45,13 +45,13 @@ public class AuthorizationManager implements ReactiveAuthorizationManager<Author
|
|
|
}
|
|
|
});
|
|
|
return mono
|
|
|
- .filter(Authentication::isAuthenticated)
|
|
|
+ .filter(authentication -> authentication.isAuthenticated() || whiteListChecker.check(path))
|
|
|
.flatMapIterable(Authentication::getAuthorities)
|
|
|
.map(GrantedAuthority::getAuthority)
|
|
|
.any(roleId -> {
|
|
|
return CollectionUtils.isEmpty(authorities)?Boolean.TRUE:authorities.contains(roleId);
|
|
|
})
|
|
|
- .map(auth -> new AuthorizationDecision(urlAuthorizationDecision.check(path)))
|
|
|
+ .map(AuthorizationDecision::new)
|
|
|
.defaultIfEmpty(new AuthorizationDecision(false));
|
|
|
}
|
|
|
}
|