diff options
Diffstat (limited to 'gerrit-server/src/main/java/com/google/gerrit/server/account/CapabilityControl.java')
-rw-r--r-- | gerrit-server/src/main/java/com/google/gerrit/server/account/CapabilityControl.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/account/CapabilityControl.java b/gerrit-server/src/main/java/com/google/gerrit/server/account/CapabilityControl.java index 1524185261..942b0d738f 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/account/CapabilityControl.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/account/CapabilityControl.java @@ -130,12 +130,24 @@ public class CapabilityControl { || canAdministrateServer(); } + + /** @return true if the user can access the database (with gsql). */ + public boolean canAccessDatabase() { + return canPerform(GlobalCapability.ACCESS_DATABASE); + } + /** @return true if the user can force replication to any configured destination. */ public boolean canStartReplication() { return canPerform(GlobalCapability.START_REPLICATION) || canAdministrateServer(); } + /** @return true if the user can run the Git garbage collection. */ + public boolean canRunGC() { + return canPerform(GlobalCapability.RUN_GC) + || canAdministrateServer(); + } + /** @return which priority queue the user's tasks should be submitted to. */ public QueueProvider.QueueType getQueueType() { // If a non-generic group (that is not Anonymous Users or Registered Users) @@ -159,6 +171,11 @@ public class CapabilityControl { case BATCH: batch = true; break; + + case ALLOW: + case BLOCK: + case DENY: + break; } } } |