mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Navigation: Support rbac for new dashboard, import dashboard and new folder (#59303)
RBAC: Support rbac for new dashboard, import dashboard and new folder page
This commit is contained in:
parent
45c759eb59
commit
a53f57cc43
@ -83,7 +83,7 @@ export function getAppRoutes(): RouteDescriptor[] {
|
||||
},
|
||||
{
|
||||
path: '/dashboard/new',
|
||||
roles: () => ['Editor', 'Admin'],
|
||||
roles: () => contextSrv.evaluatePermission(() => ['Editor', 'Admin'], [AccessControlAction.DashboardsCreate]),
|
||||
pageClass: 'page-dashboard',
|
||||
routeName: DashboardRoutes.New,
|
||||
component: SafeDynamicImport(
|
||||
@ -120,7 +120,7 @@ export function getAppRoutes(): RouteDescriptor[] {
|
||||
},
|
||||
{
|
||||
path: '/dashboard/import',
|
||||
roles: () => ['Editor', 'Admin'],
|
||||
roles: () => contextSrv.evaluatePermission(() => ['Editor', 'Admin'], [AccessControlAction.DashboardsCreate]),
|
||||
component: SafeDynamicImport(
|
||||
() => import(/* webpackChunkName: "DashboardImport"*/ 'app/features/manage-dashboards/DashboardImportPage')
|
||||
),
|
||||
@ -170,7 +170,7 @@ export function getAppRoutes(): RouteDescriptor[] {
|
||||
},
|
||||
{
|
||||
path: '/dashboards/folder/new',
|
||||
roles: () => ['Editor', 'Admin'],
|
||||
roles: () => contextSrv.evaluatePermission(() => ['Editor', 'Admin'], [AccessControlAction.FoldersCreate]),
|
||||
component: SafeDynamicImport(
|
||||
() => import(/* webpackChunkName: "NewDashboardsFolder"*/ 'app/features/folders/components/NewDashboardsFolder')
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user