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 RoleMappingService by delegating role mapping decisions to configured
invalid reference
org.glassfish.security.services.spi.RoleMappingProvider
instances.
  • Constructor Details

    • RoleMappingServiceImpl

      public RoleMappingServiceImpl()
  • Method Details

    • initialize

      public void initialize(SecurityConfiguration securityServiceConfiguration)
      Initialize the Role Mapping service with the configured role mapping provider.
      Specified by:
      initialize in interface SecurityService
    • 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 interface RoleMappingService
      Parameters:
      appContext - The application context for the query (can be null).
      subject - The target Subject.
      resource - The URI resource for the query.
      role - The target role.
      Returns:
      true if the user has the specified role.
      See Also:
    • 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 interface RoleMappingService
      Parameters:
      appContext - The application context for the query (can be null).
      subject - The target AzSubject.
      resource - The AzResource for the query.
      role - The target role.
      Returns:
      true if the user has the specified role.
      See Also:
    • findOrCreateDeploymentContext

      public RoleMappingService.RoleDeploymentContext findOrCreateDeploymentContext(String appContext)
      Find an existing RoleDeploymentContext, or create a new one if one does not already exist for the specified application context.
      Specified by:
      findOrCreateDeploymentContext in interface RoleMappingService
      Parameters:
      appContext - The application context for which the RoleDeploymentContext is desired.
      Returns:
      The resulting RoleDeploymentContext or null if the configured providers do not support this feature.
      See Also:
    • 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 interface org.glassfish.hk2.api.PostConstruct