public abstract static class PermissionBackend.WithUser extends PermissionBackend.AcceptsReviewDb<PermissionBackend.WithUser>
db
Constructor and Description |
---|
WithUser() |
database, database
public abstract PermissionBackend.ForProject project(Project.NameKey project)
public PermissionBackend.ForRef ref(Branch.NameKey ref)
ref
, and its parent project.public PermissionBackend.ForChange change(ChangeData cd)
public PermissionBackend.ForChange change(ChangeNotes notes)
public PermissionBackend.ForChange indexedChange(ChangeData cd, ChangeNotes notes)
public abstract void check(GlobalOrPluginPermission perm) throws AuthException, PermissionBackendException
perm
, throwing if denied.public void checkAny(Set<GlobalOrPluginPermission> any) throws PermissionBackendException, AuthException
If any
is empty, the method completes normally and allows the caller to continue.
Since no permissions were supplied to check, its assumed no permissions are necessary to
continue with the caller's operation.
If the user has at least one of the permissions in any
, the method completes
normally, possibly without checking all listed permissions.
If any
is non-empty and the user has none, AuthException
is thrown for one
of the failed permissions.
any
- set of permissions to check.PermissionBackendException
AuthException
public abstract <T extends GlobalOrPluginPermission> Set<T> test(Collection<T> permSet) throws PermissionBackendException
permSet
to permissions scoped user might be able to perform.PermissionBackendException
public boolean test(GlobalOrPluginPermission perm) throws PermissionBackendException
PermissionBackendException
public boolean testOrFalse(GlobalOrPluginPermission perm)
public BooleanCondition testCond(GlobalOrPluginPermission perm)
public Set<Project.NameKey> filter(ProjectPermission perm, Collection<Project.NameKey> projects) throws PermissionBackendException
check(perm)
.perm
- required permission in a project to be included in result.projects
- candidate set of projects; may be empty.projects
where check(perm)
was successful.PermissionBackendException
- backend cannot access its internal state.