From 25b51d3d3bdff2046d07df3c3bc7dc3339182a3b Mon Sep 17 00:00:00 2001
From: Alex P
Date: Wed, 18 Apr 2018 16:32:31 -0700
Subject: [PATCH] Prevent users below EDITOR from seeing add cell menu on empty
dashboard
---
.../dashboards/components/DashboardEmpty.tsx | 25 ++++++++++++-------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/ui/src/dashboards/components/DashboardEmpty.tsx b/ui/src/dashboards/components/DashboardEmpty.tsx
index f007f0956..5a450dbfd 100644
--- a/ui/src/dashboards/components/DashboardEmpty.tsx
+++ b/ui/src/dashboards/components/DashboardEmpty.tsx
@@ -7,6 +7,8 @@ import {addDashboardCellAsync} from 'src/dashboards/actions'
import {ErrorHandling} from 'src/shared/decorators/errors'
import {GRAPH_TYPES} from 'src/dashboards/graphics/graph'
+import Authorized, {EDITOR_ROLE} from 'src/auth/Authorized'
+
interface Dashboard {
id: string
cells: Cell[]
@@ -40,16 +42,21 @@ class DashboardEmpty extends Component {
This Dashboard doesn't have any Cells,
why not
add one?
-
- {GRAPH_TYPES.map(graphType => (
-
-
- {graphType.graphic}
-
{graphType.menuOption}
+
+
+ {GRAPH_TYPES.map(graphType => (
+
+
+ {graphType.graphic}
+
{graphType.menuOption}
+
-
- ))}
-
+ ))}
+
+
)
}