Allow project owner to use set-project ssh command
REST API and UI allow project owner to change the project settings so fix inconsistency by allowing the same in the ssh command. Change-Id: I123007629db87c1df6162cb1e56fc51bacff9631
This commit is contained in:
parent
fe862e319f
commit
36cc6fcc92
@ -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.
|
||||
|
@ -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;
|
||||
@ -37,7 +35,6 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@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
|
||||
@ -119,6 +116,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();
|
||||
|
Loading…
Reference in New Issue
Block a user