Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15377511
D20376.id48641.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D20376.id48641.diff
View Options
diff --git a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
--- a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
+++ b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
@@ -14,6 +14,7 @@
private $headerMode = self::HEADER_MODE_NORMAL;
private $dashboardID;
private $movable = true;
+ private $panelHandle;
public function setDashboardID($id) {
$this->dashboardID = $id;
@@ -33,6 +34,15 @@
return $this->headerMode;
}
+ public function setPanelHandle(PhabricatorObjectHandle $panel_handle) {
+ $this->panelHandle = $panel_handle;
+ return $this;
+ }
+
+ public function getPanelHandle() {
+ return $this->panelHandle;
+ }
+
/**
* Allow the engine to render the panel via Ajax.
*/
@@ -90,11 +100,19 @@
$panel = $this->getPanel();
if (!$panel) {
- return $this->renderErrorPanel(
- pht('Missing or Restricted Panel'),
- pht(
- 'This panel does not exist, or you do not have permission '.
- 'to see it.'));
+ $handle = $this->getPanelHandle();
+ if ($handle->getPolicyFiltered()) {
+ return $this->renderErrorPanel(
+ pht('Restricted Panel'),
+ pht(
+ 'You do not have permission to see this panel.'));
+ } else {
+ return $this->renderErrorPanel(
+ pht('Invalid Panel'),
+ pht(
+ 'This panel is invalid or does not exist. It may have been '.
+ 'deleted.'));
+ }
}
$panel_type = $panel->getImplementation();
@@ -185,12 +203,13 @@
->setHeader($title);
break;
}
+
$icon = id(new PHUIIconView())
->setIcon('fa-warning red msr');
$content = id(new PHUIBoxView())
->addClass('dashboard-box')
- ->addMargin(PHUI::MARGIN_MEDIUM)
+ ->addMargin(PHUI::MARGIN_LARGE)
->appendChild($icon)
->appendChild($body);
diff --git a/src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
--- a/src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
+++ b/src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
@@ -41,6 +41,14 @@
$h_mode = PhabricatorDashboardPanelRenderingEngine::HEADER_MODE_NORMAL;
}
+ $panel_phids = array();
+ foreach ($panel_grid_locations as $panel_column_locations) {
+ foreach ($panel_column_locations as $panel_phid) {
+ $panel_phids[] = $panel_phid;
+ }
+ }
+ $handles = $viewer->loadHandles($panel_phids);
+
foreach ($panel_grid_locations as $column => $panel_column_locations) {
$panel_phids = $panel_column_locations;
@@ -57,7 +65,8 @@
->setEnableAsyncRendering(true)
->setPanelPHID($panel_phid)
->setParentPanelPHIDs(array())
- ->setHeaderMode($h_mode);
+ ->setHeaderMode($h_mode)
+ ->setPanelHandle($handles[$panel_phid]);
$panel = idx($panels, $panel_phid);
if ($panel) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 14 2025, 9:20 AM (5 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7652796
Default Alt Text
D20376.id48641.diff (3 KB)
Attached To
Mode
D20376: On Dashboards, distinguish between invalid panels and restricted panels
Attached
Detach File
Event Timeline
Log In to Comment