CugAccessControlManager extends AbstractAccessControlManager implements CugConstants, PolicyOwner { @Override public AccessControlPolicy[] getPolicies(String absPath) throws RepositoryException { String oakPath = getOakPath(absPath); if (oakPath != null && isSupportedPath(oakPath)) { CugPolicy cug = getCugPolicy(oakPath); if (cug != null) { return new AccessControlPolicy[]{cug}; } } return new AccessControlPolicy[0]; } CugAccessControlManager(@NotNull Root root,
                            @NotNull NamePathMapper namePathMapper,
                            @NotNull SecurityProvider securityProvider,
                            @NotNull Set<String> supportedPaths,
                            @NotNull CugExclude cugExclude, RootProvider rootProvider); @NotNull @Override Privilege[] getSupportedPrivileges(@Nullable String absPath); @Override AccessControlPolicy[] getPolicies(String absPath); @Override AccessControlPolicy[] getEffectivePolicies(String absPath); @Override AccessControlPolicyIterator getApplicablePolicies(String absPath); @Override void removePolicy(String absPath, AccessControlPolicy policy); @Override void setPolicy(String absPath, AccessControlPolicy policy); @NotNull @Override JackrabbitAccessControlPolicy[] getApplicablePolicies(@NotNull Principal principal); @NotNull @Override JackrabbitAccessControlPolicy[] getPolicies(@NotNull Principal principal); @NotNull @Override AccessControlPolicy[] getEffectivePolicies(@NotNull Set<Principal> principals); @Override boolean defines(@Nullable String absPath, @NotNull AccessControlPolicy accessControlPolicy);  }
@Test public void testGetPolicies() throws Exception { AccessControlPolicy[] policies = cugAccessControlManager.getPolicies(SUPPORTED_PATH); assertEquals(0, policies.length); }
@Test(expected = PathNotFoundException.class) public void testGetPoliciesInvalidPath() throws Exception { cugAccessControlManager.getPolicies(INVALID_PATH); }
@Test public void testGetPoliciesUnsupportedPath() throws Exception { AccessControlPolicy[] policies = cugAccessControlManager.getPolicies(UNSUPPORTED_PATH); assertEquals(0, policies.length); }
@Test public void testGetPoliciesNullPath() throws Exception { AccessControlPolicy[] policies = cugAccessControlManager.getPolicies((String) null); assertEquals(0, policies.length); }
@Test public void testGetPoliciesByPrincipal() { AccessControlPolicy[] applicable = cugAccessControlManager.getPolicies(EveryonePrincipal.getInstance()); assertNotNull(applicable); assertEquals(0, applicable.length); }