Introduce StreamEvents capability

This change introduces new global capability for streaming
Gerrit events.

Only admins and users with this capability are able to run
gerrit stream-events.

Change-Id: I0a8a110758b0ac43969e5b8ae799b9b89db318e2
Signed-off-by: Ed Bartosh <bartosh@gmail.com>
Signed-off-by: Alexander Kanevskiy <kad@blackcatlinux.com>
This commit is contained in:
Ed Bartosh
2013-04-13 20:15:58 +03:00
committed by Alexander D. Kanevskiy
parent 72b714137b
commit d168b81bbb
7 changed files with 29 additions and 1 deletions

View File

@@ -142,6 +142,12 @@ public class CapabilityControl {
|| canAdministrateServer();
}
/** @return true if the user can stream Gerrit events. */
public boolean canStreamEvents() {
return canPerform(GlobalCapability.STREAM_EVENTS)
|| canAdministrateServer();
}
/** @return true if the user can run the Git garbage collection. */
public boolean canRunGC() {
return canPerform(GlobalCapability.RUN_GC)