Search in sources :

Example 1 with VisibleValidator

use of org.apache.jackrabbit.oak.spi.commit.VisibleValidator in project jackrabbit-oak by apache.

the class MoveAwarePermissionValidator method visibleValidator.

private Validator visibleValidator(@Nonnull Tree source, @Nonnull Tree dest) {
    // TODO improve: avoid calculating the 'before' permissions in case the current parent permissions already point to the correct tree.
    ImmutableTree immutableTree = (ImmutableTree) moveCtx.rootBefore.getTree("/");
    TreePermission tp = getPermissionProvider().getTreePermission(immutableTree, TreePermission.EMPTY);
    for (String n : PathUtils.elements(source.getPath())) {
        immutableTree = immutableTree.getChild(n);
        tp = tp.getChildPermission(n, immutableTree.getNodeState());
    }
    Validator validator = createValidator(source, dest, tp, this);
    return new VisibleValidator(validator, true, false);
}
Also used : VisibleValidator(org.apache.jackrabbit.oak.spi.commit.VisibleValidator) ImmutableTree(org.apache.jackrabbit.oak.plugins.tree.impl.ImmutableTree) TreePermission(org.apache.jackrabbit.oak.spi.security.authorization.permission.TreePermission) Validator(org.apache.jackrabbit.oak.spi.commit.Validator) VisibleValidator(org.apache.jackrabbit.oak.spi.commit.VisibleValidator)

Aggregations

ImmutableTree (org.apache.jackrabbit.oak.plugins.tree.impl.ImmutableTree)1 Validator (org.apache.jackrabbit.oak.spi.commit.Validator)1 VisibleValidator (org.apache.jackrabbit.oak.spi.commit.VisibleValidator)1 TreePermission (org.apache.jackrabbit.oak.spi.security.authorization.permission.TreePermission)1