Module io.inverno.mod.security
Class ConfigurationSourcePermissionBasedAccessControllerResolver
java.lang.Object
io.inverno.mod.security.accesscontrol.ConfigurationSourcePermissionBasedAccessControllerResolver
- All Implemented Interfaces:
AccessControllerResolver<PrincipalAuthentication,
PermissionBasedAccessController>
public class ConfigurationSourcePermissionBasedAccessControllerResolver
extends Object
implements AccessControllerResolver<PrincipalAuthentication,PermissionBasedAccessController>
Resolves a configuration source permission based access controller from a PrincipalAuthentication
.
If the authentication is also a GroupAwareAuthentication
, the groups the authenticated entity is in are used in the resulting access controller. Using roles allows to specifies permissions
to roles assigned to entities in order to facilitate access control management.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Constructor Summary
ConstructorDescriptionConfigurationSourcePermissionBasedAccessControllerResolver
(ConfigurationSource<?, ?, ?> configurationSource) Creates permission based access controller resolver with the specified configuration source.ConfigurationSourcePermissionBasedAccessControllerResolver
(ConfigurationSource<?, ?, ?> configurationSource, String rolePrefix) Creates permission based access controller resolver with the specified configuration source. -
Method Summary
Modifier and TypeMethodDescriptionresolveAccessController
(PrincipalAuthentication authentication) Resolves the access controller used to control access to services and resources for the specified authentication.
-
Constructor Details
-
ConfigurationSourcePermissionBasedAccessControllerResolver
public ConfigurationSourcePermissionBasedAccessControllerResolver(ConfigurationSource<?, ?, ?> configurationSource) Creates permission based access controller resolver with the specified configuration source.
- Parameters:
configurationSource
- a configuration source
-
ConfigurationSourcePermissionBasedAccessControllerResolver
public ConfigurationSourcePermissionBasedAccessControllerResolver(ConfigurationSource<?, ?, ?> configurationSource, String rolePrefix) Creates permission based access controller resolver with the specified configuration source.
- Parameters:
configurationSource
- a configuration sourcerolePrefix
- the prefix to prepend to a role when resolving role permissions
-
-
Method Details
-
resolveAccessController
public Mono<PermissionBasedAccessController> resolveAccessController(PrincipalAuthentication authentication) throws AccessControlException Description copied from interface:AccessControllerResolver
Resolves the access controller used to control access to services and resources for the specified authentication.
- Specified by:
resolveAccessController
in interfaceAccessControllerResolver<PrincipalAuthentication,
PermissionBasedAccessController> - Parameters:
authentication
- an authentication- Returns:
- a mono emitting the access controller or an empty mono if no access controller could have been resolved
- Throws:
AccessControlException
- if there was an error resolving the access controller
-