Class 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 org.glassfish.security.services.spi.RoleMappingProvider instances.
    • Constructor Detail

      • RoleMappingServiceImpl

        public RoleMappingServiceImpl()
    • Method Detail

      • 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:
        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 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:
        org.glassfish.security.services.api.authorization.RoleMappingService
      • 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:
        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 interface org.glassfish.hk2.api.PostConstruct