Class DefaultPermissionBackend
java.lang.Object
com.google.gerrit.server.permissions.PermissionBackend
com.google.gerrit.server.permissions.DefaultPermissionBackend
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.gerrit.server.permissions.PermissionBackend
PermissionBackend.ForChange, PermissionBackend.ForProject, PermissionBackend.ForRef, PermissionBackend.RefFilterOptions, PermissionBackend.WithUser
-
Method Summary
Modifier and TypeMethodDescriptionabsentUser
(Account.Id id) Returns an instance scoped to the provided user.Returns an instance scoped to the current user.user
(CurrentUser user) Returns an instance scoped to the specified user.boolean
Check whether thisPermissionBackend
respects the same global capabilities as theDefaultPermissionBackend
.Methods inherited from class com.google.gerrit.server.permissions.PermissionBackend
bulkEvaluateTest, checkUsesDefaultCapabilities
-
Method Details
-
currentUser
Description copied from class:PermissionBackend
Returns an instance scoped to the current user.- Specified by:
currentUser
in classPermissionBackend
-
user
Description copied from class:PermissionBackend
Returns an instance scoped to the specified user. Should be used in cases where the user could either be the issuer of the current request or an impersonated user. PermissionBackends that do not support impersonation can fail with anIllegalStateException
.If an instance scoped to the current user is desired, use
currentUser()
instead.- Specified by:
user
in classPermissionBackend
-
absentUser
Description copied from class:PermissionBackend
Returns an instance scoped to the provided user. Should be used in cases where the caller wants to check the permissions of a user who is not the issuer of the current request and not the target of impersonation.Usage should be very limited as this can expose a group-oracle.
- Specified by:
absentUser
in classPermissionBackend
-
usesDefaultCapabilities
public boolean usesDefaultCapabilities()Description copied from class:PermissionBackend
Check whether thisPermissionBackend
respects the same global capabilities as theDefaultPermissionBackend
.If true, then it makes sense for downstream callers to refer to built-in Gerrit capability names in user-facing error messages, for example.
- Overrides:
usesDefaultCapabilities
in classPermissionBackend
- Returns:
- whether this is the default permission backend.
-