Allow project owners to update project configuration

Change [1] added a ProjectControl#canPushToAtLeastOneRef check in
'ProjectAccessHandler'. This check requires users, including project
owners, must be able to perform 'PUSH' or 'CREATE_TAG' to at least
one ref. This may result in that no user can update the configuration.

This change updates ProjectControl#canPushToAtLeastOneRef so that
it will not require 'PUSH' and 'CREATE_TAG' permission for project
owners.

[1] I2a3d51ac6f7a1b423f4c801318d33234ca877c67

Bug: Issue 6544
Change-Id: I63688e04b08c7986680d9fad23aa227f365c2c83
This commit is contained in:
Changcheng Xiao
2017-06-27 18:07:02 +02:00
committed by Edwin Kempin
parent 6793fa81aa
commit f93ac680c1

View File

@@ -336,7 +336,9 @@ public class ProjectControl {
/** @return true if the user can upload to at least one reference */
public Capable canPushToAtLeastOneRef() {
if (!canPerformOnAnyRef(Permission.PUSH) && !canPerformOnAnyRef(Permission.CREATE_TAG)) {
if (!canPerformOnAnyRef(Permission.PUSH)
&& !canPerformOnAnyRef(Permission.CREATE_TAG)
&& !isOwner()) {
String pName = state.getProject().getName();
return new Capable("Upload denied for project '" + pName + "'");
}