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