private void handleAclLine()

in src/main/java/org/apache/sling/jcr/repoinit/impl/AclVisitor.java [76:96]


    private void handleAclLine(
            AclLine line, Instruction instruction, List<String> principals, List<String> paths, List<String> options)
            throws RepositoryException {
        final AclLine.Action action = line.getAction();
        if (action == AclLine.Action.REMOVE) {
            report("remove not supported. use 'remove acl' instead.");
        } else if (action == AclLine.Action.REMOVE_ALL) {
            AclUtil.removeEntries(context, principals, paths);
        } else {
            final boolean isAllow = action == AclLine.Action.ALLOW;
            final String actionName = isAllow ? "allow" : "deny";
            final List<String> privileges = line.getProperty(PROP_PRIVILEGES);
            if (instruction == Instruction.SET) {
                log.info("Adding ACL '{}' entry '{}' for {} on {}", actionName, privileges, principals, paths);
                AclUtil.setAcl(context, principals, paths, privileges, isAllow, line.getRestrictions(), options);
            } else if (instruction == Instruction.REMOVE) {
                log.info("Removing ACL '{}' entry '{}' for {} on {}", actionName, privileges, principals, paths);
                AclUtil.removeEntries(context, principals, paths, privileges, isAllow, line.getRestrictions());
            }
        }
    }