test_class.declarator: cugAccessControlManager
test_class.modifier: private
test_class.original_string: private CugAccessControlManager cugAccessControlManager;
test_class.type: CugAccessControlManager
test_class.var_name: cugAccessControlManager
test_class.file: oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/CugAccessControlManagerTest.java
test_class.identifier: CugAccessControlManagerTest
test_class.superclass: extends AbstractCugTest
test_case.body: @Test
      public void testGetEffectivePolicies() throws Exception {
          AccessControlPolicy[] policies = cugAccessControlManager.getEffectivePolicies(SUPPORTED_PATH);
          assertEquals(0, policies.length);
  
          cugAccessControlManager.setPolicy(SUPPORTED_PATH, createCug(SUPPORTED_PATH));
          root.commit();
  
          policies = cugAccessControlManager.getEffectivePolicies(SUPPORTED_PATH);
          assertEquals(1, policies.length);
  
          AccessControlPolicy[] effectiveOnChild = cugAccessControlManager.getEffectivePolicies(SUPPORTED_PATH + "/subtree");
          assertEquals(1, policies.length);
  
          assertEquals(policies.length, effectiveOnChild.length);
          assertEquals(((JackrabbitAccessControlPolicy) policies[0]).getPath(), ((JackrabbitAccessControlPolicy) effectiveOnChild[0]).getPath());
      }
test_case.class_method_signature: CugAccessControlManagerTest.testGetEffectivePolicies()
test_case.full_signature: @Test public void testGetEffectivePolicies()
test_case.identifier: testGetEffectivePolicies
test_case.invocations: getEffectivePolicies assertEquals setPolicy createCug commit getEffectivePolicies assertEquals getEffectivePolicies assertEquals assertEquals assertEquals getPath getPath
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetEffectivePolicies()
focal_class.declarator: log = LoggerFactory.getLogger(CugAccessControlManager.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(CugAccessControlManager.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: supportedPaths
focal_class.modifier: private final
focal_class.original_string: private final Set<String> supportedPaths;
focal_class.type: Set<String>
focal_class.var_name: supportedPaths
focal_class.declarator: cugExclude
focal_class.modifier: private final
focal_class.original_string: private final CugExclude cugExclude;
focal_class.type: CugExclude
focal_class.var_name: cugExclude
focal_class.declarator: config
focal_class.modifier: private final
focal_class.original_string: private final ConfigurationParameters config;
focal_class.type: ConfigurationParameters
focal_class.var_name: config
focal_class.declarator: principalManager
focal_class.modifier: private final
focal_class.original_string: private final PrincipalManager principalManager;
focal_class.type: PrincipalManager
focal_class.var_name: principalManager
focal_class.declarator: rootProvider
focal_class.modifier: private final
focal_class.original_string: private final RootProvider rootProvider;
focal_class.type: RootProvider
focal_class.var_name: rootProvider
focal_class.file: oak-authorization-cug/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/CugAccessControlManager.java
focal_class.identifier: CugAccessControlManager
focal_class.interfaces: implements CugConstants, PolicyOwner
focal_class.class_method_signature: CugAccessControlManager.CugAccessControlManager(@NotNull Root root,
                              @NotNull NamePathMapper namePathMapper,
                              @NotNull SecurityProvider securityProvider,
                              @NotNull Set<String> supportedPaths,
                              @NotNull CugExclude cugExclude, RootProvider rootProvider)
focal_class.full_signature:   CugAccessControlManager(@NotNull Root root,
                              @NotNull NamePathMapper namePathMapper,
                              @NotNull SecurityProvider securityProvider,
                              @NotNull Set<String> supportedPaths,
                              @NotNull CugExclude cugExclude, RootProvider rootProvider)
focal_class.identifier: CugAccessControlManager
focal_class.parameters: (@NotNull Root root,
                              @NotNull NamePathMapper namePathMapper,
                              @NotNull SecurityProvider securityProvider,
                              @NotNull Set<String> supportedPaths,
                              @NotNull CugExclude cugExclude, RootProvider rootProvider)
focal_class.signature:  CugAccessControlManager(@NotNull Root root,
                              @NotNull NamePathMapper namePathMapper,
                              @NotNull SecurityProvider securityProvider,
                              @NotNull Set<String> supportedPaths,
                              @NotNull CugExclude cugExclude, RootProvider rootProvider)
focal_class.class_method_signature: CugAccessControlManager.getSupportedPrivileges(@Nullable String absPath)
focal_class.full_signature: @NotNull @Override public Privilege[] getSupportedPrivileges(@Nullable String absPath)
focal_class.identifier: getSupportedPrivileges
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@Nullable String absPath)
focal_class.return: Privilege[]
focal_class.signature: Privilege[] getSupportedPrivileges(@Nullable String absPath)
focal_class.class_method_signature: CugAccessControlManager.getPolicies(String absPath)
focal_class.full_signature: @Override public AccessControlPolicy[] getPolicies(String absPath)
focal_class.identifier: getPolicies
focal_class.modifiers: @Override public
focal_class.parameters: (String absPath)
focal_class.return: AccessControlPolicy[]
focal_class.signature: AccessControlPolicy[] getPolicies(String absPath)
focal_class.class_method_signature: CugAccessControlManager.getEffectivePolicies(String absPath)
focal_class.full_signature: @Override public AccessControlPolicy[] getEffectivePolicies(String absPath)
focal_class.identifier: getEffectivePolicies
focal_class.modifiers: @Override public
focal_class.parameters: (String absPath)
focal_class.return: AccessControlPolicy[]
focal_class.signature: AccessControlPolicy[] getEffectivePolicies(String absPath)
focal_class.class_method_signature: CugAccessControlManager.getApplicablePolicies(String absPath)
focal_class.full_signature: @Override public AccessControlPolicyIterator getApplicablePolicies(String absPath)
focal_class.identifier: getApplicablePolicies
focal_class.modifiers: @Override public
focal_class.parameters: (String absPath)
focal_class.return: AccessControlPolicyIterator
focal_class.signature: AccessControlPolicyIterator getApplicablePolicies(String absPath)
focal_class.class_method_signature: CugAccessControlManager.removePolicy(String absPath, AccessControlPolicy policy)
focal_class.full_signature: @Override public void removePolicy(String absPath, AccessControlPolicy policy)
focal_class.identifier: removePolicy
focal_class.modifiers: @Override public
focal_class.parameters: (String absPath, AccessControlPolicy policy)
focal_class.return: void
focal_class.signature: void removePolicy(String absPath, AccessControlPolicy policy)
focal_class.class_method_signature: CugAccessControlManager.setPolicy(String absPath, AccessControlPolicy policy)
focal_class.full_signature: @Override public void setPolicy(String absPath, AccessControlPolicy policy)
focal_class.identifier: setPolicy
focal_class.modifiers: @Override public
focal_class.parameters: (String absPath, AccessControlPolicy policy)
focal_class.return: void
focal_class.signature: void setPolicy(String absPath, AccessControlPolicy policy)
focal_class.class_method_signature: CugAccessControlManager.getApplicablePolicies(@NotNull Principal principal)
focal_class.full_signature: @NotNull @Override public JackrabbitAccessControlPolicy[] getApplicablePolicies(@NotNull Principal principal)
focal_class.identifier: getApplicablePolicies
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull Principal principal)
focal_class.return: JackrabbitAccessControlPolicy[]
focal_class.signature: JackrabbitAccessControlPolicy[] getApplicablePolicies(@NotNull Principal principal)
focal_class.class_method_signature: CugAccessControlManager.getPolicies(@NotNull Principal principal)
focal_class.full_signature: @NotNull @Override public JackrabbitAccessControlPolicy[] getPolicies(@NotNull Principal principal)
focal_class.identifier: getPolicies
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull Principal principal)
focal_class.return: JackrabbitAccessControlPolicy[]
focal_class.signature: JackrabbitAccessControlPolicy[] getPolicies(@NotNull Principal principal)
focal_class.class_method_signature: CugAccessControlManager.getEffectivePolicies(@NotNull Set<Principal> principals)
focal_class.full_signature: @NotNull @Override public AccessControlPolicy[] getEffectivePolicies(@NotNull Set<Principal> principals)
focal_class.identifier: getEffectivePolicies
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull Set<Principal> principals)
focal_class.return: AccessControlPolicy[]
focal_class.signature: AccessControlPolicy[] getEffectivePolicies(@NotNull Set<Principal> principals)
focal_class.class_method_signature: CugAccessControlManager.defines(@Nullable String absPath, @NotNull AccessControlPolicy accessControlPolicy)
focal_class.full_signature: @Override public boolean defines(@Nullable String absPath, @NotNull AccessControlPolicy accessControlPolicy)
focal_class.identifier: defines
focal_class.modifiers: @Override public
focal_class.parameters: (@Nullable String absPath, @NotNull AccessControlPolicy accessControlPolicy)
focal_class.return: boolean
focal_class.signature: boolean defines(@Nullable String absPath, @NotNull AccessControlPolicy accessControlPolicy)
focal_class.class_method_signature: CugAccessControlManager.isSupportedPath(@Nullable String oakPath)
focal_class.full_signature: private boolean isSupportedPath(@Nullable String oakPath)
focal_class.identifier: isSupportedPath
focal_class.modifiers: private
focal_class.parameters: (@Nullable String oakPath)
focal_class.return: boolean
focal_class.signature: boolean isSupportedPath(@Nullable String oakPath)
focal_class.class_method_signature: CugAccessControlManager.checkValidPath(@Nullable String oakPath)
focal_class.full_signature: private void checkValidPath(@Nullable String oakPath)
focal_class.identifier: checkValidPath
focal_class.modifiers: private
focal_class.parameters: (@Nullable String oakPath)
focal_class.return: void
focal_class.signature: void checkValidPath(@Nullable String oakPath)
focal_class.class_method_signature: CugAccessControlManager.getCugPolicy(@NotNull String oakPath)
focal_class.full_signature: @Nullable private CugPolicy getCugPolicy(@NotNull String oakPath)
focal_class.identifier: getCugPolicy
focal_class.modifiers: @Nullable private
focal_class.parameters: (@NotNull String oakPath)
focal_class.return: CugPolicy
focal_class.signature: CugPolicy getCugPolicy(@NotNull String oakPath)
focal_class.class_method_signature: CugAccessControlManager.getCugPolicy(@NotNull String oakPath, @NotNull Tree tree, boolean isEffective)
focal_class.full_signature: @Nullable private CugPolicy getCugPolicy(@NotNull String oakPath, @NotNull Tree tree, boolean isEffective)
focal_class.identifier: getCugPolicy
focal_class.modifiers: @Nullable private
focal_class.parameters: (@NotNull String oakPath, @NotNull Tree tree, boolean isEffective)
focal_class.return: CugPolicy
focal_class.signature: CugPolicy getCugPolicy(@NotNull String oakPath, @NotNull Tree tree, boolean isEffective)
focal_class.class_method_signature: CugAccessControlManager.getPrincipals(@NotNull Tree cugTree)
focal_class.full_signature: private Iterable<Principal> getPrincipals(@NotNull Tree cugTree)
focal_class.identifier: getPrincipals
focal_class.modifiers: private
focal_class.parameters: (@NotNull Tree cugTree)
focal_class.return: Iterable<Principal>
focal_class.signature: Iterable<Principal> getPrincipals(@NotNull Tree cugTree)
focal_class.class_method_signature: CugAccessControlManager.isValidPolicy(@Nullable String absPath, @NotNull AccessControlPolicy policy)
focal_class.full_signature: private static boolean isValidPolicy(@Nullable String absPath, @NotNull AccessControlPolicy policy)
focal_class.identifier: isValidPolicy
focal_class.modifiers: private static
focal_class.parameters: (@Nullable String absPath, @NotNull AccessControlPolicy policy)
focal_class.return: boolean
focal_class.signature: boolean isValidPolicy(@Nullable String absPath, @NotNull AccessControlPolicy policy)
focal_class.class_method_signature: CugAccessControlManager.checkValidPolicy(@Nullable String absPath, @NotNull AccessControlPolicy policy)
focal_class.full_signature: private static void checkValidPolicy(@Nullable String absPath, @NotNull AccessControlPolicy policy)
focal_class.identifier: checkValidPolicy
focal_class.modifiers: private static
focal_class.parameters: (@Nullable String absPath, @NotNull AccessControlPolicy policy)
focal_class.return: void
focal_class.signature: void checkValidPolicy(@Nullable String absPath, @NotNull AccessControlPolicy policy)
focal_class.class_method_signature: CugAccessControlManager.collectEffectiveCandidates(@NotNull Root r, @NotNull Iterable<String> principalNames)
focal_class.full_signature: private Set<String> collectEffectiveCandidates(@NotNull Root r, @NotNull Iterable<String> principalNames)
focal_class.identifier: collectEffectiveCandidates
focal_class.modifiers: private
focal_class.parameters: (@NotNull Root r, @NotNull Iterable<String> principalNames)
focal_class.return: Set<String>
focal_class.signature: Set<String> collectEffectiveCandidates(@NotNull Root r, @NotNull Iterable<String> principalNames)
focal_class.class_method_signature: CugAccessControlManager.nestedCugPaths(@NotNull Tree t)
focal_class.full_signature: private static Iterable<String> nestedCugPaths(@NotNull Tree t)
focal_class.identifier: nestedCugPaths
focal_class.modifiers: private static
focal_class.parameters: (@NotNull Tree t)
focal_class.return: Iterable<String>
focal_class.signature: Iterable<String> nestedCugPaths(@NotNull Tree t)
focal_class.superclass: extends AbstractAccessControlManager
focal_method.body: @Override
      public AccessControlPolicy[] getEffectivePolicies(String absPath) throws RepositoryException {
          String oakPath = getOakPath(absPath);
          getTree(oakPath, Permissions.READ_ACCESS_CONTROL, true);
  
          boolean enabled = config.getConfigValue(CugConstants.PARAM_CUG_ENABLED, false);
          if (enabled) {
              Root r = getLatestRoot();
              List<AccessControlPolicy> effective = new ArrayList<>();
              while (oakPath != null) {
                  if (CugUtil.isSupportedPath(oakPath, supportedPaths)) {
                      CugPolicy cug = getCugPolicy(oakPath, r.getTree(oakPath), true);
                      if (cug != null) {
                          effective.add(cug);
                      }
                  }
                  oakPath = (PathUtils.denotesRoot(oakPath)) ? null : PathUtils.getAncestorPath(oakPath, 1);
              }
              return effective.toArray(new AccessControlPolicy[0]);
          } else {
              return new AccessControlPolicy[0];
          }
      }
focal_method.class_method_signature: CugAccessControlManager.getEffectivePolicies(String absPath)
focal_method.full_signature: @Override public AccessControlPolicy[] getEffectivePolicies(String absPath)
focal_method.identifier: getEffectivePolicies
focal_method.invocations: getOakPath getTree getConfigValue getLatestRoot isSupportedPath getCugPolicy getTree add denotesRoot getAncestorPath toArray
focal_method.modifiers: @Override public
focal_method.parameters: (String absPath)
focal_method.return: AccessControlPolicy[]
focal_method.signature: AccessControlPolicy[] getEffectivePolicies(String absPath)