CugAccessControlManager extends AbstractAccessControlManager implements CugConstants, PolicyOwner { @Override public boolean defines(@Nullable String absPath, @NotNull AccessControlPolicy accessControlPolicy) { return isValidPolicy(absPath, accessControlPolicy); } 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 testDefinesPathMismatch() { assertFalse(cugAccessControlManager.defines(null, createCug(SUPPORTED_PATH))); assertFalse(cugAccessControlManager.defines(SUPPORTED_PATH2, createCug(SUPPORTED_PATH))); }
@Test public void testDefinesUnsupportedPolicy() { assertFalse(cugAccessControlManager.defines(InvalidCug.INSTANCE.getPath(), InvalidCug.INSTANCE)); }
@Test public void testDefines() { CugPolicy cugPolicy = createCug(SUPPORTED_PATH); assertTrue(cugAccessControlManager.defines(cugPolicy.getPath(), cugPolicy)); }