Make ChangeControl#isOwner private

Change-Id: Icf837e629f3be7aa48eb63ac653bf1bb55772ab3
This commit is contained in:
Patrick Hiesel
2017-09-05 13:12:16 +02:00
parent 27208b1367
commit 9e4fd803c6
2 changed files with 4 additions and 2 deletions

View File

@@ -315,7 +315,7 @@ public class ChangeControl {
}
/** Is this user the owner of the change? */
boolean isOwner() {
private boolean isOwner() {
if (getUser().isIdentifiedUser()) {
Account.Id id = getUser().asIdentifiedUser().getAccountId();
return id.equals(getChange().getOwner());

View File

@@ -87,7 +87,9 @@ public class RemoveReviewerControl {
}
}
// The change owner may remove any zero or positive score.
if (changeControl.isOwner() && 0 <= value) {
if (currentUser.isIdentifiedUser()
&& currentUser.getAccountId().equals(notes.getChange().getOwner())
&& 0 <= value) {
return true;
}
// Users with the remove reviewer permission, the branch owner, project