java.lang.Object
org.apache.jackrabbit.oak.security.authorization.permission.PermissionHook
All Implemented Interfaces:
CommitHook, PostValidationHook, AccessControlConstants, PermissionConstants

public class PermissionHook extends Object implements PostValidationHook, AccessControlConstants, PermissionConstants
CommitHook implementation that processes any modification made to access control content and updates persisted permission store associated with access control related data stored in the repository.

The permission entries are grouped by principal and stored below the store root based on the hash value of the access controllable path. hash collisions are handled by adding subnodes accordingly.

   /jcr:system/rep:permissionStore/workspace-name
      /everyone
          /552423  [rep:PermissionStore]
              /0     [rep:Permissions]
              /1     [rep:Permissions]
              /c0     [rep:PermissionStore]
                  /0      [rep:Permissions]
                  /1      [rep:Permissions]
                  /2      [rep:Permissions]
              /c1     [rep:PermissionStore]
                  /0      [rep:Permissions]
                  /1      [rep:Permissions]
                  /2      [rep:Permissions]
 
  • Constructor Details

    • PermissionHook

      public PermissionHook(@NotNull @NotNull String workspaceName, @NotNull @NotNull RestrictionProvider restrictionProvider, @NotNull @NotNull ProviderCtx providerCtx)
  • Method Details

    • processCommit

      @NotNull public @NotNull NodeState processCommit(NodeState before, NodeState after, CommitInfo info)
      Description copied from interface: CommitHook
      Validates and/or modifies the given content change before it gets persisted.
      Specified by:
      processCommit in interface CommitHook
      Parameters:
      before - content tree before the commit
      after - content tree prepared for the commit
      info - metadata associated with this commit
      Returns:
      content tree to be committed
    • toString

      public String toString()
      Overrides:
      toString in class Object