mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-02 09:58:24 +01:00
Fix a fatal during breadcrumb construction when viewing a dashboard you don't have permission to view
Summary: Ref PHI662. Viewing a dashboard you don't have permission to view (in the Dashboard application) currently fatals while building crumbs, since we fail to build the ` ... > Dashboard 123 > ...` crumb. Test Plan: - Viewed a dashboard I didn't have permission to view in the Dashboards application. - Before patch, fatal when calling `getID()` on a non-object. - After patch, sensible policy error page. - Viewed a dashboard I can view, saw sensible crumbs. Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D19449
This commit is contained in:
parent
28ee6b8080
commit
29df80b48f
1 changed files with 8 additions and 5 deletions
|
@ -44,13 +44,16 @@ abstract class PhabricatorDashboardProfileController
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function buildApplicationCrumbs() {
|
protected function buildApplicationCrumbs() {
|
||||||
|
$crumbs = parent::buildApplicationCrumbs();
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
$dashboard = $this->getDashboard();
|
$dashboard = $this->getDashboard();
|
||||||
|
if ($dashboard) {
|
||||||
$id = $dashboard->getID();
|
$id = $dashboard->getID();
|
||||||
$dashboard_uri = $this->getApplicationURI("/view/{$id}/");
|
$dashboard_uri = $this->getApplicationURI("/view/{$id}/");
|
||||||
|
|
||||||
$crumbs = parent::buildApplicationCrumbs();
|
|
||||||
$crumbs->addTextCrumb($dashboard->getName(), $dashboard_uri);
|
$crumbs->addTextCrumb($dashboard->getName(), $dashboard_uri);
|
||||||
$crumbs->setBorder(true);
|
}
|
||||||
|
|
||||||
return $crumbs;
|
return $crumbs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue