Block off commands on a server for certain user groups.

This feature adds two new options to gerrit.config file: upload and
receive with the allowGroup attribute, that restrict to some specific
groups the ability to run upload/receive commands on the server.

[sp: All bugs are mine, I refactored the code a bit from the original]

Change-Id: Ibd31bd11234e429f8b0201bbb03099f737281f21
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
lincoln
2010-07-05 10:53:25 -03:00
committed by Shawn O. Pearce
parent cfe5c6b49c
commit 2be1160f05
18 changed files with 416 additions and 78 deletions

View File

@@ -58,6 +58,10 @@ final class Receive extends AbstractGitCommand {
@Override
protected void runImpl() throws IOException, Failure {
if (!projectControl.canRunReceivePack()) {
throw new Failure(1, "fatal: receive-pack not permitted on this server");
}
final ReceiveCommits receive = factory.create(projectControl, repo);
ReceiveCommits.Capable r = receive.canUpload();