Modifying AccessDecisionManager and AccessDecisionVoter
Before the introduction of AuthorizationManager
, Spring Security
introduced AccessDecisionManager
and AccessDecisionVoter
.
In certain scenarios, such as when migrating an older application, it might be preferable to incorporate an AuthorizationManager
that invokes an AccessDecisionManager
or AccessDecisionVoter
.
To invoke an existing AccessDecisionManager
, you can use:
@Component public class AccessDecisionManagerAuthorizationManagerAdapter implements AuthorizationManager { private final AccessDecisionManager accessDecisionManager; private final SecurityMetadataSource securityMetadataSource; @Override public AuthorizationDecision check(Supplier<Authentication> authentication, Object object) { try { Collection<ConfigAttribute...