From 79f39106a8d92e891ccec09287bdda97d20f79e1 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Mon, 21 Nov 2022 04:02:08 -0500 Subject: [PATCH] [v9.3.x] Navigation: Prevent viewer role accessing dashboard creation, import and folder creation (#59009) Navigation: Prevent viewer role accessing dashboard creation, import and folder creation (#58842) hide pages related dashboard import create and folder creation for viewer role (cherry picked from commit 14fbd44ac0f18b5a3dc1706aef0fca929bbb3c7d) Co-authored-by: Leo <108552997+lpskdl@users.noreply.github.com> --- public/app/routes/routes.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/app/routes/routes.tsx b/public/app/routes/routes.tsx index 1c3582f248b2..dfd9b3ba078f 100644 --- a/public/app/routes/routes.tsx +++ b/public/app/routes/routes.tsx @@ -83,6 +83,7 @@ export function getAppRoutes(): RouteDescriptor[] { }, { path: '/dashboard/new', + roles: () => ['Editor', 'Admin'], pageClass: 'page-dashboard', routeName: DashboardRoutes.New, component: SafeDynamicImport( @@ -119,6 +120,7 @@ export function getAppRoutes(): RouteDescriptor[] { }, { path: '/dashboard/import', + roles: () => ['Editor', 'Admin'], component: SafeDynamicImport( () => import(/* webpackChunkName: "DashboardImport"*/ 'app/features/manage-dashboards/DashboardImportPage') ), @@ -168,6 +170,7 @@ export function getAppRoutes(): RouteDescriptor[] { }, { path: '/dashboards/folder/new', + roles: () => ['Editor', 'Admin'], component: SafeDynamicImport( () => import(/* webpackChunkName: "NewDashboardsFolder"*/ 'app/features/folders/components/NewDashboardsFolder') ),