Interface AuthorizationManagerFactory<T extends @Nullable Object>
- Type Parameters:
T- the type of object that the authorization check is being done on
- All Known Implementing Classes:
DefaultAuthorizationManagerFactory
public interface AuthorizationManagerFactory<T extends @Nullable Object>
A factory for creating different kinds of
AuthorizationManager instances.- Since:
- 7.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault AuthorizationManager<T>Creates anAuthorizationManagerthat allows only anonymous users.default AuthorizationManager<T>Creates anAuthorizationManagerthat allows any authenticated user.default AuthorizationManager<T>denyAll()Creates anAuthorizationManagerthat does not allow anyone.default AuthorizationManager<T>Creates anAuthorizationManagerthat allows users who have authenticated and were not remembered.default AuthorizationManager<T>hasAllAuthorities(String... authorities) Creates anAuthorizationManagerthat requires users to have all the provided authorities.default AuthorizationManager<T>hasAllRoles(String... roles) Creates anAuthorizationManagerthat requires users to have all the provided roles.default AuthorizationManager<T>hasAnyAuthority(String... authorities) Creates anAuthorizationManagerthat requires users to have one of many authorities.default AuthorizationManager<T>hasAnyRole(String... roles) Creates anAuthorizationManagerthat requires users to have one of many roles.default AuthorizationManager<T>hasAuthority(String authority) Creates anAuthorizationManagerthat requires users to have the specified authority.default AuthorizationManager<T>Creates anAuthorizationManagerthat requires users to have the specified role.default AuthorizationManager<T>Create anAuthorizationManagerthat allows anyone.default AuthorizationManager<T>Creates anAuthorizationManagerthat allows users that have been remembered.
-
Method Details
-
permitAll
Create anAuthorizationManagerthat allows anyone.- Returns:
- A new
AuthorizationManagerinstance
-
denyAll
Creates anAuthorizationManagerthat does not allow anyone.- Returns:
- A new
AuthorizationManagerinstance
-
hasRole
Creates anAuthorizationManagerthat requires users to have the specified role.- Parameters:
role- the role (automatically prepended with ROLE_) that should be required to allow access (i.e. USER, ADMIN, etc.)- Returns:
- A new
AuthorizationManagerinstance
-
hasAnyRole
Creates anAuthorizationManagerthat requires users to have one of many roles.- Parameters:
roles- the roles (automatically prepended with ROLE_) that the user should have at least one of to allow access (i.e. USER, ADMIN, etc.)- Returns:
- A new
AuthorizationManagerinstance
-
hasAllRoles
Creates anAuthorizationManagerthat requires users to have all the provided roles.- Parameters:
roles- the roles (automatically prepended with ROLE_) that the user must have to allow access (i.e. USER, ADMIN, etc.)- Returns:
- A new
AuthorizationManagerinstance
-
hasAuthority
Creates anAuthorizationManagerthat requires users to have the specified authority.- Parameters:
authority- the authority that should be required to allow access (i.e. ROLE_USER, ROLE_ADMIN, etc.)- Returns:
- A new
AuthorizationManagerinstance
-
hasAnyAuthority
Creates anAuthorizationManagerthat requires users to have one of many authorities.- Parameters:
authorities- the authorities that the user should have at least one of to allow access (i.e. ROLE_USER, ROLE_ADMIN, etc.)- Returns:
- A new
AuthorizationManagerinstance
-
hasAllAuthorities
Creates anAuthorizationManagerthat requires users to have all the provided authorities.- Parameters:
authorities- the authorities that the user must have to allow access (i.e. USER, ADMIN, etc.)- Returns:
- A new
AuthorizationManagerinstance
-
authenticated
Creates anAuthorizationManagerthat allows any authenticated user.- Returns:
- A new
AuthorizationManagerinstance
-
fullyAuthenticated
Creates anAuthorizationManagerthat allows users who have authenticated and were not remembered.- Returns:
- A new
AuthorizationManagerinstance
-
rememberMe
Creates anAuthorizationManagerthat allows users that have been remembered.- Returns:
- A new
AuthorizationManagerinstance
-
anonymous
Creates anAuthorizationManagerthat allows only anonymous users.- Returns:
- A new
AuthorizationManagerinstance
-