test_class.declarator: acMgr
test_class.modifier: private
test_class.original_string: private PrincipalBasedAccessControlManager acMgr;
test_class.type: PrincipalBasedAccessControlManager
test_class.var_name: acMgr
test_class.declarator: validPrincipal
test_class.modifier: private
test_class.original_string: private ItemBasedPrincipal validPrincipal;
test_class.type: ItemBasedPrincipal
test_class.var_name: validPrincipal
test_class.file: oak-authorization-principalbased/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/principalbased/impl/PrincipalBasedAccessControlManagerTest.java
test_class.identifier: PrincipalBasedAccessControlManagerTest
test_class.superclass: extends AbstractPrincipalBasedTest
test_case.body: @Test
      public void testSetPolicyRemovedEffectivePath() throws Exception {
          setupContentTrees(TEST_OAK_PATH);
          root.commit();
  
          PrincipalPolicyImpl policy = getPrincipalPolicyImpl(validPrincipal, acMgr);
          policy.addEntry(testJcrPath, privilegesFromNames(JCR_READ));
  
          root.getTree(TEST_OAK_PATH).remove();
          root.commit();
  
          acMgr.setPolicy(policy.getPath(), policy);
          root.commit();
      }
test_case.class_method_signature: PrincipalBasedAccessControlManagerTest.testSetPolicyRemovedEffectivePath()
test_case.full_signature: @Test public void testSetPolicyRemovedEffectivePath()
test_case.identifier: testSetPolicyRemovedEffectivePath
test_case.invocations: setupContentTrees commit getPrincipalPolicyImpl addEntry privilegesFromNames remove getTree commit setPolicy getPath commit
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSetPolicyRemovedEffectivePath()
focal_class.declarator: log = LoggerFactory.getLogger(PrincipalBasedAccessControlManager.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(PrincipalBasedAccessControlManager.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: mgrProvider
focal_class.modifier: private final
focal_class.original_string: private final MgrProvider mgrProvider;
focal_class.type: MgrProvider
focal_class.var_name: mgrProvider
focal_class.declarator: importBehavior
focal_class.modifier: private final
focal_class.original_string: private final int importBehavior;
focal_class.type: int
focal_class.var_name: importBehavior
focal_class.declarator: readPaths
focal_class.modifier: private final
focal_class.original_string: private final Set<String> readPaths;
focal_class.type: Set<String>
focal_class.var_name: readPaths
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: privilegeBitsProvider
focal_class.modifier: private final
focal_class.original_string: private final PrivilegeBitsProvider privilegeBitsProvider;
focal_class.type: PrivilegeBitsProvider
focal_class.var_name: privilegeBitsProvider
focal_class.declarator: filterProvider
focal_class.modifier: private final
focal_class.original_string: private final FilterProvider filterProvider;
focal_class.type: FilterProvider
focal_class.var_name: filterProvider
focal_class.declarator: filter
focal_class.modifier: private final
focal_class.original_string: private final Filter filter;
focal_class.type: Filter
focal_class.var_name: filter
focal_class.file: oak-authorization-principalbased/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/principalbased/impl/PrincipalBasedAccessControlManager.java
focal_class.identifier: PrincipalBasedAccessControlManager
focal_class.interfaces: implements PolicyOwner, Constants
focal_class.class_method_signature: PrincipalBasedAccessControlManager.PrincipalBasedAccessControlManager(@NotNull MgrProvider mgrProvider,
                                         @NotNull FilterProvider filterProvider)
focal_class.full_signature:   PrincipalBasedAccessControlManager(@NotNull MgrProvider mgrProvider,
                                         @NotNull FilterProvider filterProvider)
focal_class.identifier: PrincipalBasedAccessControlManager
focal_class.parameters: (@NotNull MgrProvider mgrProvider,
                                         @NotNull FilterProvider filterProvider)
focal_class.signature:  PrincipalBasedAccessControlManager(@NotNull MgrProvider mgrProvider,
                                         @NotNull FilterProvider filterProvider)
focal_class.class_method_signature: PrincipalBasedAccessControlManager.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: PrincipalBasedAccessControlManager.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: PrincipalBasedAccessControlManager.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: PrincipalBasedAccessControlManager.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: PrincipalBasedAccessControlManager.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: PrincipalBasedAccessControlManager.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: PrincipalBasedAccessControlManager.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: PrincipalBasedAccessControlManager.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: PrincipalBasedAccessControlManager.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: PrincipalBasedAccessControlManager.canHandle(@Nullable Principal principal)
focal_class.full_signature: private boolean canHandle(@Nullable Principal principal)
focal_class.identifier: canHandle
focal_class.modifiers: private
focal_class.parameters: (@Nullable Principal principal)
focal_class.return: boolean
focal_class.signature: boolean canHandle(@Nullable Principal principal)
focal_class.class_method_signature: PrincipalBasedAccessControlManager.canHandle(@NotNull Set<Principal> principals)
focal_class.full_signature:  boolean canHandle(@NotNull Set<Principal> principals)
focal_class.identifier: canHandle
focal_class.parameters: (@NotNull Set<Principal> principals)
focal_class.return: boolean
focal_class.signature: boolean canHandle(@NotNull Set<Principal> principals)
focal_class.class_method_signature: PrincipalBasedAccessControlManager.checkValidPolicy(@Nullable String absPath, @NotNull AccessControlPolicy policy)
focal_class.full_signature: private PrincipalPolicyImpl checkValidPolicy(@Nullable String absPath, @NotNull AccessControlPolicy policy)
focal_class.identifier: checkValidPolicy
focal_class.modifiers: private
focal_class.parameters: (@Nullable String absPath, @NotNull AccessControlPolicy policy)
focal_class.return: PrincipalPolicyImpl
focal_class.signature: PrincipalPolicyImpl checkValidPolicy(@Nullable String absPath, @NotNull AccessControlPolicy policy)
focal_class.class_method_signature: PrincipalBasedAccessControlManager.getPolicyTree(@NotNull Tree accessControlledTree)
focal_class.full_signature: @NotNull private static Tree getPolicyTree(@NotNull Tree accessControlledTree)
focal_class.identifier: getPolicyTree
focal_class.modifiers: @NotNull private static
focal_class.parameters: (@NotNull Tree accessControlledTree)
focal_class.return: Tree
focal_class.signature: Tree getPolicyTree(@NotNull Tree accessControlledTree)
focal_class.class_method_signature: PrincipalBasedAccessControlManager.createPolicy(@NotNull Principal principal,
                                                         boolean isEffectivePolicy)
focal_class.full_signature: @Nullable private JackrabbitAccessControlPolicy createPolicy(@NotNull Principal principal,
                                                         boolean isEffectivePolicy)
focal_class.identifier: createPolicy
focal_class.modifiers: @Nullable private
focal_class.parameters: (@NotNull Principal principal,
                                                         boolean isEffectivePolicy)
focal_class.return: JackrabbitAccessControlPolicy
focal_class.signature: JackrabbitAccessControlPolicy createPolicy(@NotNull Principal principal,
                                                         boolean isEffectivePolicy)
focal_class.class_method_signature: PrincipalBasedAccessControlManager.isAccessControlled(@NotNull Tree tree)
focal_class.full_signature: private boolean isAccessControlled(@NotNull Tree tree)
focal_class.identifier: isAccessControlled
focal_class.modifiers: private
focal_class.parameters: (@NotNull Tree tree)
focal_class.return: boolean
focal_class.signature: boolean isAccessControlled(@NotNull Tree tree)
focal_class.class_method_signature: PrincipalBasedAccessControlManager.getEffectivePaths(@Nullable String oakPath)
focal_class.full_signature: private Iterable<String> getEffectivePaths(@Nullable String oakPath)
focal_class.identifier: getEffectivePaths
focal_class.modifiers: private
focal_class.parameters: (@Nullable String oakPath)
focal_class.return: Iterable<String>
focal_class.signature: Iterable<String> getEffectivePaths(@Nullable String oakPath)
focal_class.class_method_signature: PrincipalBasedAccessControlManager.createEffectiveEntry(@NotNull Tree entryTree)
focal_class.full_signature: @Nullable private AbstractEntry createEffectiveEntry(@NotNull Tree entryTree)
focal_class.identifier: createEffectiveEntry
focal_class.modifiers: @Nullable private
focal_class.parameters: (@NotNull Tree entryTree)
focal_class.return: AbstractEntry
focal_class.signature: AbstractEntry createEffectiveEntry(@NotNull Tree entryTree)
focal_class.class_method_signature: PrincipalBasedAccessControlManager.isReadablePath(@Nullable String oakPath)
focal_class.full_signature: private boolean isReadablePath(@Nullable String oakPath)
focal_class.identifier: isReadablePath
focal_class.modifiers: private
focal_class.parameters: (@Nullable String oakPath)
focal_class.return: boolean
focal_class.signature: boolean isReadablePath(@Nullable String oakPath)
focal_class.superclass: extends AbstractAccessControlManager
focal_method.body: @Override
      public void setPolicy(String absPath, AccessControlPolicy policy) throws RepositoryException {
          PrincipalPolicyImpl pp = checkValidPolicy(absPath, policy);
          String oakPath = pp.getOakPath();
          Tree tree = getTree(oakPath, Permissions.MODIFY_ACCESS_CONTROL, true);
  
          Tree policyTree = getPolicyTree(tree);
          if (policyTree.exists()) {
              policyTree.remove();
          }
  
          // make sure parent has mixin set and policy node is properly initialized
          TreeUtil.addMixin(tree, MIX_REP_PRINCIPAL_BASED_MIXIN, getRoot().getTree(NodeTypeConstants.NODE_TYPES_PATH), getRoot().getContentSession().getAuthInfo().getUserID());
          policyTree = TreeUtil.addChild(tree, REP_PRINCIPAL_POLICY, NT_REP_PRINCIPAL_POLICY);
          policyTree.setOrderableChildren(true);
          policyTree.setProperty(Constants.REP_PRINCIPAL_NAME, pp.getPrincipal().getName());
  
          int i = 0;
          RestrictionProvider restrictionProvider = mgrProvider.getRestrictionProvider();
          for (PrincipalPolicyImpl.EntryImpl entry : pp.getEntries()) {
              String effectiveOakPath = Strings.nullToEmpty(entry.getOakPath());
              Tree entryTree = TreeUtil.addChild(policyTree, "entry" + i++, NT_REP_PRINCIPAL_ENTRY);
              if (!Utils.hasModAcPermission(getPermissionProvider(), effectiveOakPath)) {
                  throw new AccessDeniedException("Access denied.");
              }
              entryTree.setProperty(REP_EFFECTIVE_PATH, effectiveOakPath, Type.PATH);
              entryTree.setProperty(Constants.REP_PRIVILEGES, privilegeBitsProvider.getPrivilegeNames(entry.getPrivilegeBits()), Type.NAMES);
              restrictionProvider.writeRestrictions(oakPath, entryTree, entry.getRestrictions());
          }
      }
focal_method.class_method_signature: PrincipalBasedAccessControlManager.setPolicy(String absPath, AccessControlPolicy policy)
focal_method.full_signature: @Override public void setPolicy(String absPath, AccessControlPolicy policy)
focal_method.identifier: setPolicy
focal_method.invocations: checkValidPolicy getOakPath getTree getPolicyTree exists remove addMixin getTree getRoot getUserID getAuthInfo getContentSession getRoot addChild setOrderableChildren setProperty getName getPrincipal getRestrictionProvider getEntries nullToEmpty getOakPath addChild hasModAcPermission getPermissionProvider setProperty setProperty getPrivilegeNames getPrivilegeBits writeRestrictions getRestrictions
focal_method.modifiers: @Override public
focal_method.parameters: (String absPath, AccessControlPolicy policy)
focal_method.return: void
focal_method.signature: void setPolicy(String absPath, AccessControlPolicy policy)