Package org.wildfly.security.authz
Class SimplePermissionMapper.Builder
java.lang.Object
org.wildfly.security.authz.SimplePermissionMapper.Builder
- Enclosing class:
- SimplePermissionMapper
A builder for simple permission mappers.
-
Method Summary
Modifier and TypeMethodDescriptionaddMapping(Set<String> principals, Set<String> roles, PermissionVerifier permissionVerifier) Add a new mapping to aPermissionVerifier, if thePermissionMappablebeing mapped has a principal name that is in theSetof principals or of any of the assigned roles are matched this mapping will be a match.addMatchAllPrincipals(PermissionVerifier permissionVerifier) Add a new mapping to aPermissionVerifier, if thePermissionMappablebeing mapped has a principal or any of the assigned roles are matched this mapping will be a match.build()Build and return the resultingPermissionMapper.setMappingMode(SimplePermissionMapper.MappingMode mappingMode) Set the mapping mode that the newly createdPermissionMappershould use.
-
Method Details
-
setMappingMode
public SimplePermissionMapper.Builder setMappingMode(SimplePermissionMapper.MappingMode mappingMode) Set the mapping mode that the newly createdPermissionMappershould use.- Parameters:
mappingMode- the mapping mode.- Returns:
thisbuilder to allow chaining.
-
addMapping
public SimplePermissionMapper.Builder addMapping(Set<String> principals, Set<String> roles, PermissionVerifier permissionVerifier) Add a new mapping to aPermissionVerifier, if thePermissionMappablebeing mapped has a principal name that is in theSetof principals or of any of the assigned roles are matched this mapping will be a match.- Parameters:
principals- the principal names to compare with thePermissionMappableprincipal.roles- the role names to compare with the roles being passed for mapping.permissionVerifier- thePermissionVerifierto use in the event of a resulting match.- Returns:
thisbuilder to allow chaining.
-
addMatchAllPrincipals
Add a new mapping to aPermissionVerifier, if thePermissionMappablebeing mapped has a principal or any of the assigned roles are matched this mapping will be a match.- Parameters:
permissionVerifier- thePermissionVerifierto use in the event of a resulting match.- Returns:
thisbuilder to allow chaining.
-
build
Build and return the resultingPermissionMapper.- Returns:
- the resulting
PermissionMapper
-