Interface RoleMappingService
-
- All Superinterfaces:
SecurityService
- All Known Implementing Classes:
RoleMappingServiceImpl
@Contract public interface RoleMappingService extends SecurityService
TheRoleMappingServiceprovides functions that determine a user's role.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceRoleMappingService.RoleDeploymentContextThis interface represents aRoleDeploymentContextas returned by the Role Mapping Service's findOrCreateDeploymentContext() method.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RoleMappingService.RoleDeploymentContextfindOrCreateDeploymentContext(String appContext)Find an existingRoleDeploymentContext, or create a new one if one does not already exist for the specified application context.booleanisUserInRole(String appContext, Subject subject, URI resource, String role)Determine whether the user (Subject) has the indicated role for a given resource (URI) and application context.booleanisUserInRole(String appContext, AzSubject subject, AzResource resource, String role)Determine whether the user (AzSubject) has the indicated role for a given resource (AzResource) and application context.-
Methods inherited from interface org.glassfish.security.services.api.SecurityService
initialize
-
-
-
-
Method Detail
-
isUserInRole
boolean isUserInRole(String appContext, Subject subject, URI resource, String role)
Determine whether the user (Subject) has the indicated role for a given resource (URI) and application context.- Parameters:
appContext- The application context for the query (can be null).subject- The targetSubject.resource- TheURIresource for the query.role- The target role.- Returns:
- true if the user has the specified role.
- Throws:
IllegalArgumentException- for anullsubject or resourceIllegalStateException- if the service was not initialized.
-
isUserInRole
boolean isUserInRole(String appContext, AzSubject subject, AzResource resource, String role)
Determine whether the user (AzSubject) has the indicated role for a given resource (AzResource) and application context.- Parameters:
appContext- The application context for the query (can be null).subject- The target.AzSubjectresource- Thefor the query.AzResourcerole- The target role.- Returns:
- true if the user has the specified role.
- Throws:
IllegalArgumentException- for anullsubject or resourceIllegalStateException- if the service was not initialized.
-
findOrCreateDeploymentContext
RoleMappingService.RoleDeploymentContext findOrCreateDeploymentContext(String appContext)
Find an existingRoleDeploymentContext, or create a new one if one does not already exist for the specified application context. The role deployment context will be returned in an "open" state, and will stay that way until commit() or delete() is called.- Parameters:
appContext- The application context for which theRoleDeploymentContextis desired.- Returns:
- The resulting
RoleDeploymentContextornullif the configured providers do not support this feature. - Throws:
IllegalStateException- if the service was not initialized.
-
-