Class PermissionBackend.ForProject
- java.lang.Object
-
- com.google.gerrit.server.permissions.PermissionBackend.AcceptsReviewDb<PermissionBackend.ForProject>
-
- com.google.gerrit.server.permissions.PermissionBackend.ForProject
-
- Direct Known Subclasses:
ProjectControl.ForProjectImpl
- Enclosing class:
- PermissionBackend
public abstract static class PermissionBackend.ForProject extends PermissionBackend.AcceptsReviewDb<PermissionBackend.ForProject>
PermissionBackend scoped to a user and project.
-
-
Field Summary
-
Fields inherited from class com.google.gerrit.server.permissions.PermissionBackend.AcceptsReviewDb
db
-
-
Constructor Summary
Constructors Constructor Description ForProject()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description PermissionBackend.ForChange
change(ChangeNotes notes)
PermissionBackend.ForChange
change(ChangeData cd)
abstract void
check(ProjectPermission perm)
Verify scoped user canperm
, throwing if denied.PermissionBackend.ForChange
indexedChange(ChangeData cd, ChangeNotes notes)
abstract PermissionBackend.ForRef
ref(String ref)
boolean
test(ProjectPermission perm)
abstract Set<ProjectPermission>
test(Collection<ProjectPermission> permSet)
FilterpermSet
to permissions scoped user might be able to perform.BooleanCondition
testCond(ProjectPermission perm)
boolean
testOrFalse(ProjectPermission perm)
abstract PermissionBackend.ForProject
user(CurrentUser user)
-
Methods inherited from class com.google.gerrit.server.permissions.PermissionBackend.AcceptsReviewDb
database, database
-
-
-
-
Method Detail
-
user
public abstract PermissionBackend.ForProject user(CurrentUser user)
- Returns:
- new instance rescoped to same project, but different
user
.
-
ref
public abstract PermissionBackend.ForRef ref(String ref)
- Returns:
- instance scoped for
ref
in this project.
-
change
public PermissionBackend.ForChange change(ChangeData cd)
- Returns:
- instance scoped for the change, and its destination ref and project.
-
change
public PermissionBackend.ForChange change(ChangeNotes notes)
- Returns:
- instance scoped for the change, and its destination ref and project.
-
indexedChange
public PermissionBackend.ForChange indexedChange(ChangeData cd, ChangeNotes notes)
- Returns:
- instance scoped for the change loaded from index, and its destination ref and project. This method should only be used when database access is harmful and potentially stale data from the index is acceptable.
-
check
public abstract void check(ProjectPermission perm) throws AuthException, PermissionBackendException
Verify scoped user canperm
, throwing if denied.
-
test
public abstract Set<ProjectPermission> test(Collection<ProjectPermission> permSet) throws PermissionBackendException
FilterpermSet
to permissions scoped user might be able to perform.- Throws:
PermissionBackendException
-
test
public boolean test(ProjectPermission perm) throws PermissionBackendException
- Throws:
PermissionBackendException
-
testOrFalse
public boolean testOrFalse(ProjectPermission perm)
-
testCond
public BooleanCondition testCond(ProjectPermission perm)
-
-