Merge "Make ChangeControl#isOwner private"

This commit is contained in:
Patrick Hiesel
2017-09-06 10:57:30 +00:00
committed by Gerrit Code Review
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