Interface PermissionMapper

All Known Implementing Classes:
SimplePermissionMapper
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface PermissionMapper
A permission mapper is responsible to enable permission mapping to a SecurityDomain in order to obtain and check permissions based on an previously authorized identity and any other authorization information (eg.: roles) associated with it.
Author:
Pedro Igor
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final PermissionMapper
    A default implementation that does nothing but returns an empty and read-only PermissionVerifier.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a new mapper where the PermissionVerifier created by this PermissionMapper is combined with the PermissionVerifier of the other PermissionMapper using 'and'.
    createConstant(org.wildfly.security.permission.PermissionVerifier verifier)
    Returns a new mapper that maps all to pre-defined PermissionVerifier instance.
    org.wildfly.security.permission.PermissionVerifier
    mapPermissions(PermissionMappable permissionMappable, Roles roles)
    Returns a PermissionVerifier with all the permissions associated with the given information.
    Returns a new mapper where the PermissionVerifier created by this PermissionMapper is combined with the PermissionVerifier of the other PermissionMapper using 'or'.
    Returns a new mapper where the PermissionVerifier created by this PermissionMapper is combined with the PermissionVerifier of the other PermissionMapper using 'unless'.
    Returns a new mapper where the PermissionVerifier created by this PermissionMapper is combined with the PermissionVerifier of the other PermissionMapper using 'xor'.
  • Field Details

    • EMPTY_PERMISSION_MAPPER

      static final PermissionMapper EMPTY_PERMISSION_MAPPER
      A default implementation that does nothing but returns an empty and read-only PermissionVerifier.
  • Method Details

    • mapPermissions

      org.wildfly.security.permission.PermissionVerifier mapPermissions(PermissionMappable permissionMappable, Roles roles)

      Returns a PermissionVerifier with all the permissions associated with the given information.

      Once returned, client code can use the PermissionVerifier.implies(Permission) to check if a given permission is granted or not to the given principal. Implementors must make sure that the returned collection is immutable.

      Parameters:
      permissionMappable - the object to which permissions can be mapped (must not be null)
      roles - a set of effective roles after all role mapping was applied by security domain (may be null)
      Returns:
      a permission verifier (not null)
    • and

      default PermissionMapper and(PermissionMapper other)
      Returns a new mapper where the PermissionVerifier created by this PermissionMapper is combined with the PermissionVerifier of the other PermissionMapper using 'and'.
      Parameters:
      other - the other PermissionMapper to combine with this PermissionMapper
      Returns:
      the combined PermissionMapper
    • or

      default PermissionMapper or(PermissionMapper other)
      Returns a new mapper where the PermissionVerifier created by this PermissionMapper is combined with the PermissionVerifier of the other PermissionMapper using 'or'.
      Parameters:
      other - the other PermissionMapper to combine with this PermissionMapper
      Returns:
      the combined PermissionMapper
    • xor

      default PermissionMapper xor(PermissionMapper other)
      Returns a new mapper where the PermissionVerifier created by this PermissionMapper is combined with the PermissionVerifier of the other PermissionMapper using 'xor'.
      Parameters:
      other - the other PermissionMapper to combine with this PermissionMapper
      Returns:
      the combined PermissionMapper
    • unless

      default PermissionMapper unless(PermissionMapper other)
      Returns a new mapper where the PermissionVerifier created by this PermissionMapper is combined with the PermissionVerifier of the other PermissionMapper using 'unless'.
      Parameters:
      other - the other PermissionMapper to combine with this PermissionMapper
      Returns:
      the combined PermissionMapper
    • createConstant

      static PermissionMapper createConstant(org.wildfly.security.permission.PermissionVerifier verifier)
      Returns a new mapper that maps all to pre-defined PermissionVerifier instance.
      Parameters:
      verifier - the PermissionVerifier that will be returned for anybody.
      Returns:
      the constant PermissionVerifier