Class DefaultPermissionBackend
- java.lang.Object
-
- com.google.gerrit.server.permissions.PermissionBackend
-
- com.google.gerrit.server.permissions.DefaultPermissionBackend
-
public class DefaultPermissionBackend extends PermissionBackend
-
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PermissionBackend.WithUser
absentUser(Account.Id id)
Returns an instance scoped to the provided user.PermissionBackend.WithUser
currentUser()
Returns an instance scoped to the current user.PermissionBackend.WithUser
user(CurrentUser user)
Returns an instance scoped to the specified user.boolean
usesDefaultCapabilities()
Check whether thisPermissionBackend
respects the same global capabilities as theDefaultPermissionBackend
.-
Methods inherited from class com.google.gerrit.server.permissions.PermissionBackend
bulkEvaluateTest, checkUsesDefaultCapabilities
-
-
-
-
Method Detail
-
currentUser
public PermissionBackend.WithUser currentUser()
Description copied from class:PermissionBackend
Returns an instance scoped to the current user.- Specified by:
currentUser
in classPermissionBackend
-
user
public PermissionBackend.WithUser user(CurrentUser 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
public PermissionBackend.WithUser absentUser(Account.Id id)
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.
-
-