From 98a301a59b1df7eb5c0512a054a38a6f99d7c303 Mon Sep 17 00:00:00 2001
From: Joshua Spence <josh@freelancer.com>
Date: Sat, 31 Oct 2015 04:54:16 +0000
Subject: [PATCH] Set `$can_edit` for Harbormaster steps

Summary: Sets the `$can_edit` value correctly (previously it was hardcoded to `true`).

Test Plan: Went to http://phabricator.local/harbormaster/step/view/1/ and saw "Edit Step" disabled.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14373
---
 .../controller/HarbormasterStepViewController.php            | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/applications/harbormaster/controller/HarbormasterStepViewController.php b/src/applications/harbormaster/controller/HarbormasterStepViewController.php
index 1af7f2fe16..d8d1d3f0b0 100644
--- a/src/applications/harbormaster/controller/HarbormasterStepViewController.php
+++ b/src/applications/harbormaster/controller/HarbormasterStepViewController.php
@@ -97,7 +97,10 @@ final class HarbormasterStepViewController extends HarbormasterController {
       ->setUser($viewer)
       ->setObject($step);
 
-    $can_edit = true;
+    $can_edit = PhabricatorPolicyFilter::hasCapability(
+      $viewer,
+      $step,
+      PhabricatorPolicyCapability::CAN_EDIT);
 
     $list->addAction(
       id(new PhabricatorActionView())