Allow users to "Edit a Copy" when trying to edit a panel they don't own

Summary:
Fixes T5167. When clicking "Edit" on a dashboard panel you don't own, the UI now allows you to make a copy instead.

As a bonus, fixes T5259.

Test Plan: See screenshots.

Reviewers: chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T5259, T5167

Differential Revision: https://secure.phabricator.com/D9505
This commit is contained in:
epriestley
2014-06-12 15:14:47 -07:00
parent 6f4ebcb8d9
commit 408d71cdd3
6 changed files with 161 additions and 19 deletions

View File

@@ -15,6 +15,10 @@ final class PhabricatorDashboardManageController
$id = $this->id;
$dashboard_uri = $this->getApplicationURI('view/'.$id.'/');
// TODO: This UI should drop a lot of capabilities if the user can't
// edit the dashboard, but we should still let them in for "Install" and
// "View History".
$dashboard = id(new PhabricatorDashboardQuery())
->setViewer($viewer)
->withIDs(array($this->id))