AbstractAccessControlManager implements JackrabbitAccessControlManager, AccessControlConstants { @Override public boolean hasPrivileges(@Nullable String absPath, @Nullable Privilege[] privileges) throws RepositoryException { return hasPrivileges(absPath, privileges, getPermissionProvider(), Permissions.NO_PERMISSION, false); } protected  AbstractAccessControlManager(@NotNull Root root,
                                           @NotNull NamePathMapper namePathMapper,
                                           @NotNull SecurityProvider securityProvider); @NotNull @Override Privilege[] getSupportedPrivileges(@Nullable String absPath); @NotNull @Override Privilege privilegeFromName(@NotNull String privilegeName); @Override boolean hasPrivileges(@Nullable String absPath, @Nullable Privilege[] privileges); @NotNull @Override Privilege[] getPrivileges(@Nullable String absPath); @Override boolean hasPrivileges(@Nullable String absPath, @NotNull Set<Principal> principals, @Nullable Privilege[] privileges); @NotNull @Override Privilege[] getPrivileges(@Nullable String absPath, @NotNull Set<Principal> principals);  }
@Test public void testHasNullPrivileges() throws Exception { assertTrue(acMgr.hasPrivileges(testPath, null)); }
@Test public void testHasEmptyPrivileges() throws Exception { assertTrue(acMgr.hasPrivileges(testPath, new Privilege[0])); }
@Test(expected = PathNotFoundException.class) public void testHasPrivilegesNonExistingNodePath() throws Exception { acMgr.hasPrivileges(nonExistingPath, testPrivileges); }
@Test(expected = PathNotFoundException.class) public void testHasPrivilegesNonExistingNodePathEveryoneSet() throws Exception { acMgr.hasPrivileges(nonExistingPath, getEveryonePrincipalSet(), testPrivileges); }
@Test(expected = PathNotFoundException.class) public void testHasPrivilegesNonExistingNodePathEmptyPrincipalSet() throws Exception { acMgr.hasPrivileges(nonExistingPath, ImmutableSet.<Principal>of(), testPrivileges); }
@Test public void testHasPrivilegesInvalidPaths() { for (String path : getInvalidPaths()) { try { acMgr.hasPrivileges(path, testPrivileges); fail("AccessControlManager#hasPrivileges for node that doesn't exist should fail."); } catch (RepositoryException e) { } } }
@Test public void testHasPrivileges() throws Exception { assertTrue(acMgr.hasPrivileges(testPath, allPrivileges)); }
@Test public void testHasPrivilegesSessionSet() throws Exception { assertTrue(acMgr.hasPrivileges(testPath, testPrincipals, allPrivileges)); }
@Test public void testHasPrivilegesInvalidPathsEveryoneSet() { for (String path : getInvalidPaths()) { try { acMgr.hasPrivileges(path, ImmutableSet.<Principal>of(EveryonePrincipal.getInstance()), testPrivileges); fail("AccessControlManager#hasPrivileges for node that doesn't exist should fail."); } catch (RepositoryException e) { } } }
@Test public void testHasRepoPrivileges() throws Exception { assertTrue(acMgr.hasPrivileges(null, testPrivileges)); }
@Test public void testHasRepoPrivilegesEveryoneSet() throws Exception { assertFalse(acMgr.hasPrivileges(null, getEveryonePrincipalSet(), testPrivileges)); }
@Test public void testHasRepoPrivilegesEmptyPrincipalSet() throws Exception { assertFalse(acMgr.hasPrivileges(null, ImmutableSet.<Principal>of(), testPrivileges)); }