mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 00:41:08 +08: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:
@ -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')
|
||||
),
|
||||
|
Reference in New Issue
Block a user