Merge branch 'stable-2.13' into stable-2.14

* stable-2.13:
  Allow project owner to use set-project ssh command

Change-Id: I221769284f34901c07f7eba645eb3367c20ee982
This commit is contained in:
David Pursehouse
2017-04-12 10:51:51 +09:00
2 changed files with 4 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ The command is argument-safe, that is, if no argument is given the
previous settings are kept intact.
== ACCESS
Caller must be a member of the privileged 'Administrators' group.
Caller must be an owner of the given project.
== SCRIPTING
This command is intended to be used in scripts.

View File

@@ -14,8 +14,6 @@
package com.google.gerrit.sshd.commands;
import com.google.gerrit.common.data.GlobalCapability;
import com.google.gerrit.extensions.annotations.RequiresCapability;
import com.google.gerrit.extensions.client.InheritableBoolean;
import com.google.gerrit.extensions.client.ProjectState;
import com.google.gerrit.extensions.client.SubmitType;
@@ -35,7 +33,6 @@ import org.kohsuke.args4j.Option;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
@CommandMetaData(name = "set-project", description = "Change a project's settings")
final class SetProjectCommand extends SshCommand {
private static final Logger log = LoggerFactory.getLogger(SetProjectCommand.class);
@@ -153,6 +150,9 @@ final class SetProjectCommand extends SshCommand {
@Override
protected void run() throws Failure {
if (!projectControl.isOwner()) {
throw new UnloggedFailure(1, "restricted to project owner");
}
Project ctlProject = projectControl.getProject();
Project.NameKey nameKey = ctlProject.getNameKey();
String name = ctlProject.getName();