@Override public boolean isGranted(long repositoryPermissions) { EntryPredicate predicate = new EntryPredicate(); return hasPermissions(getEntryIterator(predicate), predicate, repositoryPermissions, null); } };
@Override public boolean apply(@Nullable PermissionEntry entry) { return apply(entry, true); }
private EntryIterator(@NotNull EntryPredicate predicate) { this.predicate = predicate; this.path = Strings.nullToEmpty(predicate.getPath()); }
@Override public boolean isGranted(long repositoryPermissions) { EntryPredicate predicate = new EntryPredicate(); return hasPermissions(getEntryIterator(predicate), predicate, repositoryPermissions, null); } };
@Override public boolean apply(@Nullable PermissionEntry entry) { return apply(entry, true); }
private EntryIterator(@NotNull EntryPredicate predicate) { this.predicate = predicate; this.path = Strings.nullToEmpty(predicate.getPath()); }
@Override public boolean isGranted(long repositoryPermissions) { EntryPredicate predicate = new EntryPredicate(); return hasPermissions(getEntryIterator(predicate), predicate, repositoryPermissions, null); } };
@Override public boolean apply(@Nullable PermissionEntry entry) { return apply(entry, true); }
private EntryIterator(@Nonnull EntryPredicate predicate) { this.predicate = predicate; this.path = Strings.nullToEmpty(predicate.getPath()); }
private Iterator<PermissionEntry> getIterator(@Nullable PropertyState property, long permissions) { EntryPredicate predicate = new EntryPredicate(tree, property, Permissions.respectParentPermissions(permissions)); return getIterator(predicate); }
@Override protected PermissionEntry getNext() { PermissionEntry next = null; while (next == null) { if (nextEntries.hasNext()) { PermissionEntry pe = nextEntries.next(); if (predicate.apply(pe)) { next = pe; } else { treePermission.skipped = true; } } else { if (tp == null) { break; } nextEntries = (isUser) ? tp.getUserEntries() : tp.getGroupEntries(); tp = tp.parent; } } return next; } }
private Iterator<PermissionEntry> getIterator(@Nullable PropertyState property, long permissions) { EntryPredicate predicate = new EntryPredicate(tree, property, Permissions.respectParentPermissions(permissions)); return getIterator(predicate); }
@Override protected PermissionEntry getNext() { PermissionEntry next = null; while (next == null) { if (nextEntries.hasNext()) { PermissionEntry pe = nextEntries.next(); if (predicate.apply(pe)) { next = pe; } else { treePermission.skipped = true; } } else { if (tp == null) { break; } nextEntries = (isUser) ? tp.getUserEntries() : tp.getGroupEntries(); tp = tp.parent; } } return next; } }
private Iterator<PermissionEntry> getIterator(@Nullable PropertyState property, long permissions) { EntryPredicate predicate = new EntryPredicate(tree, property, Permissions.respectParentPermissions(permissions)); return concat(new LazyIterator(this, true, predicate), new LazyIterator(this, false, predicate)); }
@Override protected PermissionEntry getNext() { PermissionEntry next = null; while (next == null) { if (nextEntries.hasNext()) { PermissionEntry pe = nextEntries.next(); if (predicate.apply(pe)) { next = pe; } else { treePermission.skipped = true; } } else { if (tp == null) { break; } nextEntries = (isUser) ? tp.getUserEntries() : tp.getGroupEntries(); tp = tp.parent; } } return next; } }
@Override public boolean isGranted(@Nonnull String path, long permissions) { EntryPredicate predicate = new EntryPredicate(path, Permissions.respectParentPermissions(permissions)); return hasPermissions(getEntryIterator(predicate), predicate, permissions, path); }
@Override protected PermissionEntry getNext() { PermissionEntry next = null; while (next == null) { if (nextEntries.hasNext()) { PermissionEntry pe = nextEntries.next(); if (predicate.apply(pe)) { next = pe; } } else { if (path == null) { break; } nextEntries = getEntries(path).iterator(); path = PermissionUtil.getParentPathOrNull(path); } } return next; } }
@Override public boolean isGranted(long permissions, @NotNull PropertyState property) { EntryPredicate predicate = new EntryPredicate(tree, property, Permissions.respectParentPermissions(permissions)); Iterator<PermissionEntry> it = getIterator(predicate); return hasPermissions(it, predicate, permissions, tree.getPath()); }
@Override protected PermissionEntry getNext() { PermissionEntry next = null; while (next == null) { if (nextEntries.hasNext()) { PermissionEntry pe = nextEntries.next(); if (predicate.apply(pe)) { next = pe; } } else { if (path == null) { break; } nextEntries = getEntries(path).iterator(); path = PermissionUtil.getParentPathOrNull(path); } } return next; } }
@Override public boolean isGranted(@NotNull String path, long permissions) { EntryPredicate predicate = new EntryPredicate(path, Permissions.respectParentPermissions(permissions)); return hasPermissions(getEntryIterator(predicate), predicate, permissions, path); }