readPolicy = (readPaths.isEmpty()) ? EmptyReadPolicy.INSTANCE : new DefaultReadPolicy(readPaths);
@Override public boolean isReadableTree(@Nonnull Tree tree, @Nullable TreePermissionImpl parent) { if (parent != null) { if (parent.isReadableTree) { return true; } else if (!isDefaultPaths || parent.tree.getName().equals(JcrConstants.JCR_SYSTEM)) { return isReadableTree(tree, true); } else { return false; } } else { return isReadableTree(tree, true); } }
readPolicy = (readPaths.isEmpty()) ? EmptyReadPolicy.INSTANCE : new DefaultReadPolicy(readPaths);
private CompiledPermissionImpl(@Nonnull Set<Principal> principals, @Nonnull Root root, @Nonnull String workspaceName, @Nonnull PermissionStore store, @Nonnull RestrictionProvider restrictionProvider, @Nonnull ConfigurationParameters options, @Nonnull Context ctx) { this.root = root; this.workspaceName = workspaceName; bitsProvider = new PrivilegeBitsProvider(root); Set<String> readPaths = options.getConfigValue(PARAM_READ_PATHS, DEFAULT_READ_PATHS); readPolicy = (readPaths.isEmpty()) ? EmptyReadPolicy.INSTANCE : new DefaultReadPolicy(readPaths); // setup this.store = store; Set<String> userNames = new HashSet<String>(principals.size()); Set<String> groupNames = new HashSet<String>(principals.size()); for (Principal principal : principals) { if (principal instanceof Group) { groupNames.add(principal.getName()); } else { userNames.add(principal.getName()); } } PermissionEntryCache cache = new PermissionEntryCache(); userStore = new PermissionEntryProviderImpl(store, cache, userNames, options); groupStore = new PermissionEntryProviderImpl(store, cache, groupNames, options); typeProvider = new TreeTypeProvider(ctx); }
@Override public boolean isReadableTree(@NotNull Tree tree, @Nullable TreePermissionImpl parent) { if (parent != null) { if (parent.isReadableTree) { return true; } else if (!isDefaultPaths || parent.tree.getName().equals(JcrConstants.JCR_SYSTEM)) { return isReadableTree(tree, true); } else { return false; } } else { return isReadableTree(tree, true); } }
@Override public boolean isReadableTree(@NotNull Tree tree, @Nullable TreePermissionImpl parent) { if (parent != null) { if (parent.isReadableTree) { return true; } else if (!isDefaultPaths || parent.tree.getName().equals(JcrConstants.JCR_SYSTEM)) { return isReadableTree(tree, true); } else { return false; } } else { return isReadableTree(tree, true); } }