Class Jsr250AuthorizationManager
java.lang.Object
org.springframework.security.authorization.method.Jsr250AuthorizationManager
- All Implemented Interfaces:
AuthorizationManager<org.aopalliance.intercept.MethodInvocation>
public final class Jsr250AuthorizationManager
extends Object
implements AuthorizationManager<org.aopalliance.intercept.MethodInvocation>
An
AuthorizationManager
which can determine if an Authentication
may
invoke the MethodInvocation
by evaluating if the Authentication
contains a specified authority from the JSR-250 security annotations.- Since:
- 5.6
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncheck
(Supplier<Authentication> authentication, org.aopalliance.intercept.MethodInvocation methodInvocation) Deprecated.void
setAuthoritiesAuthorizationManager
(AuthorizationManager<Collection<String>> authoritiesAuthorizationManager) Sets anAuthorizationManager
that accepts a collection of authority strings.void
setRolePrefix
(String rolePrefix) Sets the role prefix.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.security.authorization.AuthorizationManager
authorize, verify
-
Constructor Details
-
Jsr250AuthorizationManager
public Jsr250AuthorizationManager()
-
-
Method Details
-
setAuthoritiesAuthorizationManager
public void setAuthoritiesAuthorizationManager(AuthorizationManager<Collection<String>> authoritiesAuthorizationManager) Sets anAuthorizationManager
that accepts a collection of authority strings.- Parameters:
authoritiesAuthorizationManager
- theAuthorizationManager
that accepts a collection of authority strings to use- Since:
- 6.2
-
setRolePrefix
Sets the role prefix. Defaults to "ROLE_".- Parameters:
rolePrefix
- the role prefix to use
-
check
@Deprecated public AuthorizationDecision check(Supplier<Authentication> authentication, org.aopalliance.intercept.MethodInvocation methodInvocation) Deprecated.please useAuthorizationManager.authorize(Supplier, Object)
insteadDetermine if anAuthentication
has access to a method by evaluating theDenyAll
,PermitAll
, andRolesAllowed
annotations thatMethodInvocation
specifies.- Specified by:
check
in interfaceAuthorizationManager<org.aopalliance.intercept.MethodInvocation>
- Parameters:
authentication
- theSupplier
of theAuthentication
to checkmethodInvocation
- theMethodInvocation
to check- Returns:
- an
AuthorizationDecision
or null if the JSR-250 security annotations is not present
-
AuthorizationManager.authorize(Supplier, Object)
instead