Make PublishAction require ownership & visiblity
Previously, PublishAction allowed reviewers of the draft change to publish. Correct functionality should only allow the change owner to publish. In addition the change visibility has to be checked, because a change is not visible to the change owner if the project state is HIDDEN. In addition, the behaviour in PublishAction was inconsistent with the behaviour in ReviewCommand. This change makes both perform the same check before publishing. Change-Id: Ic306ab6a0dd49f23073f198c9dc8e9eaa90ecccc
This commit is contained in:
@@ -28,6 +28,7 @@ public class ChangeDetail {
|
||||
protected AccountInfoCache accounts;
|
||||
protected boolean allowsAnonymous;
|
||||
protected boolean canAbandon;
|
||||
protected boolean canPublish;
|
||||
protected boolean canRestore;
|
||||
protected boolean canRevert;
|
||||
protected boolean canDeleteDraft;
|
||||
@@ -71,6 +72,14 @@ public class ChangeDetail {
|
||||
canAbandon = a;
|
||||
}
|
||||
|
||||
public boolean canPublish() {
|
||||
return canPublish;
|
||||
}
|
||||
|
||||
public void setCanPublish(final boolean a) {
|
||||
canPublish = a;
|
||||
}
|
||||
|
||||
public boolean canRestore() {
|
||||
return canRestore;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user