mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboard: Do not allow users without edit permission to a folder to see new dashboard page (#28249)
This commit is contained in:
parent
fa45731b7f
commit
f22b768ce4
@ -1,6 +1,8 @@
|
|||||||
import './dashboard_loaders';
|
import './dashboard_loaders';
|
||||||
import './ReactContainer';
|
import './ReactContainer';
|
||||||
import { applyRouteRegistrationHandlers } from './registry';
|
import { applyRouteRegistrationHandlers } from './registry';
|
||||||
|
import { contextSrv } from 'app/core/services/context_srv';
|
||||||
|
|
||||||
// Pages
|
// Pages
|
||||||
import LdapPage from 'app/features/admin/ldap/LdapPage';
|
import LdapPage from 'app/features/admin/ldap/LdapPage';
|
||||||
import UserAdminPage from 'app/features/admin/UserAdminPage';
|
import UserAdminPage from 'app/features/admin/UserAdminPage';
|
||||||
@ -70,6 +72,7 @@ export function setupAngularRoutes($routeProvider: route.IRouteProvider, $locati
|
|||||||
routeInfo: DashboardRouteInfo.New,
|
routeInfo: DashboardRouteInfo.New,
|
||||||
reloadOnSearch: false,
|
reloadOnSearch: false,
|
||||||
resolve: {
|
resolve: {
|
||||||
|
roles: () => (contextSrv.hasEditPermissionInFolders ? [contextSrv.user.orgRole] : ['Admin']),
|
||||||
component: importDashboardPage,
|
component: importDashboardPage,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user