Class AuthoritiesAuthorizationManager
java.lang.Object
org.springframework.security.authorization.AuthoritiesAuthorizationManager
- All Implemented Interfaces:
- AuthorizationManager<Collection<String>>
public final class AuthoritiesAuthorizationManager
extends Object
implements AuthorizationManager<Collection<String>>
An 
AuthorizationManager that determines if the current user is authorized by
 evaluating if the Authentication contains any of the specified authorities.- Since:
- 6.1
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncheck(Supplier<Authentication> authentication, Collection<String> authorities) Determines if the current user is authorized by evaluating if theAuthenticationcontains any of specified authorities.voidsetRoleHierarchy(RoleHierarchy roleHierarchy) Sets theRoleHierarchyto be used.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.authorization.AuthorizationManagerauthorize, verify
- 
Constructor Details- 
AuthoritiesAuthorizationManagerpublic AuthoritiesAuthorizationManager()
 
- 
- 
Method Details- 
setRoleHierarchySets theRoleHierarchyto be used. Default isNullRoleHierarchy. Cannot be null.- Parameters:
- roleHierarchy- the- RoleHierarchyto use
 
- 
checkpublic AuthorityAuthorizationDecision check(Supplier<Authentication> authentication, Collection<String> authorities) Determines if the current user is authorized by evaluating if theAuthenticationcontains any of specified authorities.- Specified by:
- checkin interface- AuthorizationManager<Collection<String>>
- Parameters:
- authentication- the- Supplierof the- Authenticationto check
- authorities- the collection of authority strings to check
- Returns:
- an AuthorityAuthorizationDecision
 
 
-