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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user