Class RoleMappingServiceImpl
- java.lang.Object
-
- org.glassfish.security.services.impl.authorization.RoleMappingServiceImpl
-
- All Implemented Interfaces:
org.glassfish.hk2.api.PostConstruct
,RoleMappingService
,SecurityService
@Service @Singleton public final class RoleMappingServiceImpl extends Object implements RoleMappingService, org.glassfish.hk2.api.PostConstruct
RoleMappingServiceImpl
implements
by delegating role mapping decisions to configuredRoleMappingService
instances.org.glassfish.security.services.spi.RoleMappingProvider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.security.services.api.authorization.RoleMappingService
RoleMappingService.RoleDeploymentContext
-
-
Constructor Summary
Constructors Constructor Description RoleMappingServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RoleMappingService.RoleDeploymentContext
findOrCreateDeploymentContext(String appContext)
Find an existingRoleDeploymentContext
, or create a new one if one does not already exist for the specified application context.void
initialize(SecurityConfiguration securityServiceConfiguration)
Initialize the Role Mapping service with the configured role mapping provider.boolean
isUserInRole(String appContext, Subject subject, URI resource, String role)
Determine the user's role by converting arguments into security authorization data types.boolean
isUserInRole(String appContext, AzSubject subject, AzResource resource, String role)
Determine if the user's is in the specified role.void
postConstruct()
Handle lookup of role mapping service configuration and initialization.
-
-
-
Method Detail
-
initialize
public void initialize(SecurityConfiguration securityServiceConfiguration)
Initialize the Role Mapping service with the configured role mapping provider.- Specified by:
initialize
in interfaceSecurityService
-
isUserInRole
public boolean isUserInRole(String appContext, Subject subject, URI resource, String role)
Determine the user's role by converting arguments into security authorization data types.- Specified by:
isUserInRole
in interfaceRoleMappingService
- Parameters:
appContext
- The application context for the query (can be null).subject
- The targetSubject
.resource
- TheURI
resource for the query.role
- The target role.- Returns:
- true if the user has the specified role.
- See Also:
org.glassfish.security.services.api.authorization.RoleMappingService
-
isUserInRole
public boolean isUserInRole(String appContext, AzSubject subject, AzResource resource, String role)
Determine if the user's is in the specified role.- Specified by:
isUserInRole
in interfaceRoleMappingService
- Parameters:
appContext
- The application context for the query (can be null).subject
- The target
.AzSubject
resource
- The
for the query.AzResource
role
- The target role.- Returns:
- true if the user has the specified role.
- See Also:
org.glassfish.security.services.api.authorization.RoleMappingService
-
findOrCreateDeploymentContext
public RoleMappingService.RoleDeploymentContext findOrCreateDeploymentContext(String appContext)
Find an existingRoleDeploymentContext
, or create a new one if one does not already exist for the specified application context.- Specified by:
findOrCreateDeploymentContext
in interfaceRoleMappingService
- Parameters:
appContext
- The application context for which theRoleDeploymentContext
is desired.- Returns:
- The resulting
RoleDeploymentContext
ornull
if the configured providers do not support this feature. - See Also:
org.glassfish.security.services.api.authorization.RoleMappingService
-
postConstruct
public void postConstruct()
Handle lookup of role mapping service configuration and initialization. If no service or provider is configured the service run-time will throw exceptions. Addresses alternate configuration handling until adopt @Proxiable support.- Specified by:
postConstruct
in interfaceorg.glassfish.hk2.api.PostConstruct
-
-