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.
Author:
Darran Lofthouse
  • Method Details

    • setMappingMode

      Set the mapping mode that the newly created PermissionMapper should use.
      Parameters:
      mappingMode - the mapping mode.
      Returns:
      this builder to allow chaining.
    • addMapping

      public SimplePermissionMapper.Builder addMapping(Set<String> principals, Set<String> roles, org.wildfly.security.permission.PermissionVerifier permissionVerifier)
      Add a new mapping to a PermissionVerifier, if the PermissionMappable being mapped has a principal name that is in the Set 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 the PermissionMappable principal.
      roles - the role names to compare with the roles being passed for mapping.
      permissionVerifier - the PermissionVerifier to use in the event of a resulting match.
      Returns:
      this builder to allow chaining.
    • addMatchAllPrincipals

      public SimplePermissionMapper.Builder addMatchAllPrincipals(org.wildfly.security.permission.PermissionVerifier permissionVerifier)
      Add a new mapping to a PermissionVerifier, if the PermissionMappable being mapped has a principal or any of the assigned roles are matched this mapping will be a match.
      Parameters:
      permissionVerifier - the PermissionVerifier to use in the event of a resulting match.
      Returns:
      this builder to allow chaining.
    • build

      public PermissionMapper build()
      Build and return the resulting PermissionMapper.
      Returns:
      the resulting PermissionMapper