Class PermissionBackend.ForRef
- java.lang.Object
-
- com.google.gerrit.server.permissions.PermissionBackend.AcceptsReviewDb<PermissionBackend.ForRef>
-
- com.google.gerrit.server.permissions.PermissionBackend.ForRef
-
- Enclosing class:
- PermissionBackend
public abstract static class PermissionBackend.ForRef extends PermissionBackend.AcceptsReviewDb<PermissionBackend.ForRef>
PermissionBackend scoped to a user, project and reference.
-
-
Field Summary
-
Fields inherited from class com.google.gerrit.server.permissions.PermissionBackend.AcceptsReviewDb
db
-
-
Constructor Summary
Constructors Constructor Description ForRef()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract PermissionBackend.ForChange
change(ChangeNotes notes)
abstract PermissionBackend.ForChange
change(ChangeData cd)
abstract void
check(RefPermission perm)
Verify scoped user canperm
, throwing if denied.abstract PermissionBackend.ForChange
indexedChange(ChangeData cd, ChangeNotes notes)
boolean
test(RefPermission perm)
abstract Set<RefPermission>
test(Collection<RefPermission> permSet)
FilterpermSet
to permissions scoped user might be able to perform.BooleanCondition
testCond(RefPermission perm)
boolean
testOrFalse(RefPermission perm)
Test if user may be able to perform the permission.abstract PermissionBackend.ForRef
user(CurrentUser user)
-
Methods inherited from class com.google.gerrit.server.permissions.PermissionBackend.AcceptsReviewDb
database, database
-
-
-
-
Method Detail
-
user
public abstract PermissionBackend.ForRef user(CurrentUser user)
- Returns:
- new instance rescoped to same reference, but different
user
.
-
change
public abstract PermissionBackend.ForChange change(ChangeData cd)
- Returns:
- instance scoped to change.
-
change
public abstract PermissionBackend.ForChange change(ChangeNotes notes)
- Returns:
- instance scoped to change.
-
indexedChange
public abstract PermissionBackend.ForChange indexedChange(ChangeData cd, ChangeNotes notes)
- Returns:
- instance scoped to change loaded from index. 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(RefPermission perm) throws AuthException, PermissionBackendException
Verify scoped user canperm
, throwing if denied.
-
test
public abstract Set<RefPermission> test(Collection<RefPermission> permSet) throws PermissionBackendException
FilterpermSet
to permissions scoped user might be able to perform.- Throws:
PermissionBackendException
-
test
public boolean test(RefPermission perm) throws PermissionBackendException
- Throws:
PermissionBackendException
-
testOrFalse
public boolean testOrFalse(RefPermission perm)
Test if user may be able to perform the permission.Similar to
test(RefPermission)
except this method returnsfalse
instead of throwing an exception.- Parameters:
perm
- the permission to test.- Returns:
- true if the user might be able to perform the permission; false if the user may be missing the necessary grants or state, or if the backend threw an exception.
-
testCond
public BooleanCondition testCond(RefPermission perm)
-
-