test_class.declarator: permissionStore
test_class.modifier: private
test_class.original_string: private PermissionStoreImpl permissionStore;
test_class.type: PermissionStoreImpl
test_class.var_name: permissionStore
test_class.declarator: testPrincipal
test_class.modifier: private
test_class.original_string: private Principal testPrincipal;
test_class.type: Principal
test_class.var_name: testPrincipal
test_class.declarator: testPath = "/testPath"
test_class.modifier: private
test_class.original_string: private String testPath = "/testPath";
test_class.type: String
test_class.var_name: testPath
test_class.declarator: childPath = "/testPath/childNode"
test_class.modifier: private
test_class.original_string: private String childPath = "/testPath/childNode";
test_class.type: String
test_class.var_name: childPath
test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionStoreImplTest.java
test_class.identifier: PermissionStoreImplTest
test_class.interfaces: implements PermissionConstants
test_class.superclass: extends AbstractSecurityTest
test_case.body: @Test
      public void testLoadByPathWithCollision() throws Exception {
          try {
              Tree everyoneTree = getPermissionRoot(EveryonePrincipal.NAME);
              Tree aa = TreeUtil.addChild(everyoneTree, "/Aa".hashCode() +"", NT_REP_PERMISSION_STORE);
              aa.setProperty(REP_ACCESS_CONTROLLED_PATH, "/Aa");
              Tree entry = TreeUtil.addChild(aa, "1", NT_REP_PERMISSIONS);
              entry.setProperty(PrivilegeBits.BUILT_IN.get(REP_READ_NODES).asPropertyState(REP_PRIVILEGE_BITS));
              entry.setProperty(REP_IS_ALLOW, false);
  
              Tree collision = TreeUtil.addChild(aa, "c_"+"/BB".hashCode(), NT_REP_PERMISSION_STORE);
              collision.setProperty(REP_ACCESS_CONTROLLED_PATH, "/BB");
              Tree entryBB = TreeUtil.addChild(collision, "1", NT_REP_PERMISSIONS);
              entryBB.setProperty(PrivilegeBits.BUILT_IN.get(REP_READ_NODES).asPropertyState(REP_PRIVILEGE_BITS));
              entryBB.setProperty(REP_IS_ALLOW, true);
  
              // a single allow entry for /BB (must descend to collision tree)
              Collection<PermissionEntry> entries = permissionStore.load(EveryonePrincipal.NAME, "/BB");
              assertNotNull(entries);
              assertEquals(1, entries.size());
              assertTrue(entries.iterator().next().isAllow);
  
              // a single deny entry for /Aa
              entries = permissionStore.load(EveryonePrincipal.NAME, "/Aa");
              assertNotNull(entries);
              assertFalse(entries.iterator().next().isAllow);
  
          } finally {
              root.refresh();
          }
      }
test_case.class_method_signature: PermissionStoreImplTest.testLoadByPathWithCollision()
test_case.full_signature: @Test public void testLoadByPathWithCollision()
test_case.identifier: testLoadByPathWithCollision
test_case.invocations: getPermissionRoot addChild hashCode setProperty addChild setProperty asPropertyState get setProperty addChild hashCode setProperty addChild setProperty asPropertyState get setProperty load assertNotNull assertEquals size assertTrue next iterator load assertNotNull assertFalse next iterator refresh
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLoadByPathWithCollision()
focal_class.declarator: log = LoggerFactory.getLogger(PermissionStoreImpl.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(PermissionStoreImpl.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: permissionRootName
focal_class.modifier: private final
focal_class.original_string: private final String permissionRootName;
focal_class.type: String
focal_class.var_name: permissionRootName
focal_class.declarator: restrictionProvider
focal_class.modifier: private final
focal_class.original_string: private final RestrictionProvider restrictionProvider;
focal_class.type: RestrictionProvider
focal_class.var_name: restrictionProvider
focal_class.declarator: principalTreeMap = new HashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, Tree> principalTreeMap = new HashMap<>();
focal_class.type: Map<String, Tree>
focal_class.var_name: principalTreeMap
focal_class.declarator: permissionsTree
focal_class.modifier: private
focal_class.original_string: private Tree permissionsTree;
focal_class.type: Tree
focal_class.var_name: permissionsTree
focal_class.declarator: bitsProvider
focal_class.modifier: private
focal_class.original_string: private PrivilegeBitsProvider bitsProvider;
focal_class.type: PrivilegeBitsProvider
focal_class.var_name: bitsProvider
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionStoreImpl.java
focal_class.identifier: PermissionStoreImpl
focal_class.interfaces: implements PermissionStore, PermissionConstants
focal_class.class_method_signature: PermissionStoreImpl.PermissionStoreImpl(@NotNull Root root, @NotNull String permissionRootName, @NotNull RestrictionProvider restrictionProvider)
focal_class.full_signature:   PermissionStoreImpl(@NotNull Root root, @NotNull String permissionRootName, @NotNull RestrictionProvider restrictionProvider)
focal_class.identifier: PermissionStoreImpl
focal_class.parameters: (@NotNull Root root, @NotNull String permissionRootName, @NotNull RestrictionProvider restrictionProvider)
focal_class.signature:  PermissionStoreImpl(@NotNull Root root, @NotNull String permissionRootName, @NotNull RestrictionProvider restrictionProvider)
focal_class.class_method_signature: PermissionStoreImpl.flush(@NotNull Root root)
focal_class.full_signature: @Override public void flush(@NotNull Root root)
focal_class.identifier: flush
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull Root root)
focal_class.return: void
focal_class.signature: void flush(@NotNull Root root)
focal_class.class_method_signature: PermissionStoreImpl.reset(@NotNull Root root)
focal_class.full_signature: private void reset(@NotNull Root root)
focal_class.identifier: reset
focal_class.modifiers: private
focal_class.parameters: (@NotNull Root root)
focal_class.return: void
focal_class.signature: void reset(@NotNull Root root)
focal_class.class_method_signature: PermissionStoreImpl.load(@NotNull String principalName, @NotNull String path)
focal_class.full_signature: @Nullable @Override public Collection<PermissionEntry> load(@NotNull String principalName, @NotNull String path)
focal_class.identifier: load
focal_class.modifiers: @Nullable @Override public
focal_class.parameters: (@NotNull String principalName, @NotNull String path)
focal_class.return: Collection<PermissionEntry>
focal_class.signature: Collection<PermissionEntry> load(@NotNull String principalName, @NotNull String path)
focal_class.class_method_signature: PermissionStoreImpl.getNumEntries(@NotNull String principalName, long max)
focal_class.full_signature: @NotNull @Override public NumEntries getNumEntries(@NotNull String principalName, long max)
focal_class.identifier: getNumEntries
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull String principalName, long max)
focal_class.return: NumEntries
focal_class.signature: NumEntries getNumEntries(@NotNull String principalName, long max)
focal_class.class_method_signature: PermissionStoreImpl.load(@NotNull String principalName)
focal_class.full_signature: @Override @NotNull public PrincipalPermissionEntries load(@NotNull String principalName)
focal_class.identifier: load
focal_class.modifiers: @Override @NotNull public
focal_class.parameters: (@NotNull String principalName)
focal_class.return: PrincipalPermissionEntries
focal_class.signature: PrincipalPermissionEntries load(@NotNull String principalName)
focal_class.class_method_signature: PermissionStoreImpl.getPrincipalRoot(@NotNull String principalName)
focal_class.full_signature: @Nullable private Tree getPrincipalRoot(@NotNull String principalName)
focal_class.identifier: getPrincipalRoot
focal_class.modifiers: @Nullable private
focal_class.parameters: (@NotNull String principalName)
focal_class.return: Tree
focal_class.signature: Tree getPrincipalRoot(@NotNull String principalName)
focal_class.class_method_signature: PermissionStoreImpl.loadPermissionEntries(@NotNull Tree tree,
                                         @NotNull PrincipalPermissionEntries principalPermissionEntries)
focal_class.full_signature: private void loadPermissionEntries(@NotNull Tree tree,
                                         @NotNull PrincipalPermissionEntries principalPermissionEntries)
focal_class.identifier: loadPermissionEntries
focal_class.modifiers: private
focal_class.parameters: (@NotNull Tree tree,
                                         @NotNull PrincipalPermissionEntries principalPermissionEntries)
focal_class.return: void
focal_class.signature: void loadPermissionEntries(@NotNull Tree tree,
                                         @NotNull PrincipalPermissionEntries principalPermissionEntries)
focal_class.class_method_signature: PermissionStoreImpl.loadPermissionEntries(@NotNull String path,
                                                                @NotNull Tree tree)
focal_class.full_signature: @NotNull private Collection<PermissionEntry> loadPermissionEntries(@NotNull String path,
                                                                @NotNull Tree tree)
focal_class.identifier: loadPermissionEntries
focal_class.modifiers: @NotNull private
focal_class.parameters: (@NotNull String path,
                                                                @NotNull Tree tree)
focal_class.return: Collection<PermissionEntry>
focal_class.signature: Collection<PermissionEntry> loadPermissionEntries(@NotNull String path,
                                                                @NotNull Tree tree)
focal_class.class_method_signature: PermissionStoreImpl.createPermissionEntry(@NotNull String path,
                                                    @NotNull Tree entryTree)
focal_class.full_signature: @NotNull private PermissionEntry createPermissionEntry(@NotNull String path,
                                                    @NotNull Tree entryTree)
focal_class.identifier: createPermissionEntry
focal_class.modifiers: @NotNull private
focal_class.parameters: (@NotNull String path,
                                                    @NotNull Tree entryTree)
focal_class.return: PermissionEntry
focal_class.signature: PermissionEntry createPermissionEntry(@NotNull String path,
                                                    @NotNull Tree entryTree)
focal_method.body: @Nullable
      @Override
      public Collection<PermissionEntry> load(@NotNull String principalName, @NotNull String path) {
          Tree principalRoot = getPrincipalRoot(principalName);
          Collection<PermissionEntry> entries = null;
          if (principalRoot != null) {
              String name = PermissionUtil.getEntryName(path);
              if (principalRoot.hasChild(name)) {
                  Tree child = principalRoot.getChild(name);
                  if (PermissionUtil.checkACLPath(child, path)) {
                      entries = loadPermissionEntries(path, child);
                  } else {
                      // check for child node : there may at most be one child for
                      // the given path.
                      for (Tree node : child.getChildren()) {
                          if (PermissionUtil.checkACLPath(node, path)) {
                              entries = loadPermissionEntries(path, node);
                              break;
                          }
                      }
                  }
              }
          }
          return entries;
      }
focal_method.class_method_signature: PermissionStoreImpl.load(@NotNull String principalName, @NotNull String path)
focal_method.full_signature: @Nullable @Override public Collection<PermissionEntry> load(@NotNull String principalName, @NotNull String path)
focal_method.identifier: load
focal_method.invocations: getPrincipalRoot getEntryName hasChild getChild checkACLPath loadPermissionEntries getChildren checkACLPath loadPermissionEntries
focal_method.modifiers: @Nullable @Override public
focal_method.parameters: (@NotNull String principalName, @NotNull String path)
focal_method.return: Collection<PermissionEntry>
focal_method.signature: Collection<PermissionEntry> load(@NotNull String principalName, @NotNull String path)