Class AbstractCustomPolicyProcessor

All Implemented Interfaces:
Direct Known Subclasses:

public abstract class AbstractCustomPolicyProcessor extends Object implements PolicyProcessor
Base class for custom PolicyProcessor that can be used for optimizing the performance of flows. These policy processors should be registered for the Phase.GUARD and Phase.QUERY phases.
  • Field Details

    • typeManager

      protected final TypeManager typeManager
  • Constructor Details

    • AbstractCustomPolicyProcessor

      protected AbstractCustomPolicyProcessor(TypeManager typeManager)
  • Method Details

    • processPolicy

      public void processPolicy(PolicyBuilder policy, Object target)
      Description copied from interface: PolicyProcessor
      Post-process the given policy. On phase `LOGIN`, the `target` is the principal being logged in, on phase `GUARD`, it's the object being guarded. On phase `LOGIN` the `policy` is the entire policy containing all rules that affect the current user, on phase `GUARD` the policy only contains the rules that are relevant to the guarded objects (the entire policy, if needed, can be retrieved from the SecurityContext).
      Specified by:
      processPolicy in interface PolicyProcessor
    • doProcessPolicy

      protected abstract void doProcessPolicy(PolicyBuilder policy, EntityModel entityModel)
    • handlePrincipal

      protected abstract boolean handlePrincipal(Principal principal)
    • handleEntityModel

      protected abstract boolean handleEntityModel(EntityModel entityModel)
    • appendRule

      protected void appendRule(PolicyBuilder policy, EntityModel entityModel, AccessPermission permission, Node condition, boolean negative)
    • prependRule

      protected void prependRule(PolicyBuilder policy, EntityModel entityModel, AccessPermission permission, Node condition, boolean negative)