Skip to content

Commit

Permalink
Merge branch 'hotfix/cancel-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
ewingrj committed Dec 1, 2018
2 parents fe28485 + e392ef3 commit 751d030
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/services/milestones/getApprovedKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ const getApprovedKeys = (milestone, data, user) => {
return ['txHash', 'status', 'mined', 'message', 'proofItems'];
}

// Cancel milestone by Campaign or Milestone Reviewer
// Cancel milestone by Milestone Manager or Milestone Reviewer
if (data.status === MilestoneStatus.CANCELED && data.mined === false) {
if (!reviewers.includes(user.address)) {
if (![milestone.reviewerAddress, milestone.ownerAddress].includes(user.address)) {
throw new errors.Forbidden(
'Only the Milestone or Campaign Reviewer can cancel a milestone',
'Only the Milestone Manager or Milestone Reviewer can cancel a milestone',
);
}

Expand Down Expand Up @@ -154,11 +154,11 @@ const getApprovedKeys = (milestone, data, user) => {
return ['status', 'mined', 'message', 'proofItems'];
}

// Cancel milestone by Campaign or Milestone Reviewer
// Cancel milestone by Milestone Manager or Milestone Reviewer
if (data.status === MilestoneStatus.CANCELED && data.mined === false) {
if (!reviewers.includes(user.address)) {
if (![milestone.reviewerAddress, milestone.ownerAddress].includes(user.address)) {
throw new errors.Forbidden(
'Only the Milestone or Campaign Reviewer can cancel a milestone',
'Only the Milestone Manager or Milestone Reviewer can cancel a milestone',
);
}
logger.info(
Expand Down

0 comments on commit 751d030

Please sign in to comment.