Class PermissionBackend.ForRef
java.lang.Object
com.google.gerrit.server.permissions.PermissionBackend.ForRef
- Enclosing class:
- PermissionBackend
PermissionBackend scoped to a user, project and reference.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract PermissionBackend.ForChange
change
(ChangeNotes notes) Returns an instance scoped to change.abstract PermissionBackend.ForChange
change
(ChangeData cd) Returns an instance scoped to change.abstract void
check
(RefPermission perm) Verify scoped user canperm
, throwing if denied.abstract String
Returns a fully qualified resource path that this instance is scoped to.boolean
test
(RefPermission perm) abstract Set<RefPermission>
test
(Collection<RefPermission> permSet) FilterpermSet
to permissions scoped user might be able to perform.abstract BooleanCondition
testCond
(RefPermission perm) boolean
testOrFalse
(RefPermission perm) Test if user may be able to perform the permission.
-
Constructor Details
-
ForRef
public ForRef()
-
-
Method Details
-
resourcePath
Returns a fully qualified resource path that this instance is scoped to. -
change
Returns an instance scoped to change. -
change
Returns an instance scoped to change. -
check
Verify scoped user canperm
, throwing if denied.Should be used in REST API handlers where the thrown
AuthException
can be propagated. In business logic, where the exception would have to be caught, prefer usingtest(RefPermission)
. -
test
public abstract Set<RefPermission> test(Collection<RefPermission> permSet) throws PermissionBackendException FilterpermSet
to permissions scoped user might be able to perform.- Throws:
PermissionBackendException
-
test
- Throws:
PermissionBackendException
-
testOrFalse
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
-