mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 20:12:25 +08:00
Drilldown: Require datasources:explore
RBAC action (#101366)
Drilldown: Require `datasources:explore` acton
This commit is contained in:
@ -66,9 +66,6 @@ func (hs *HTTPServer) declareFixedRoles() error {
|
|||||||
{
|
{
|
||||||
Action: ac.ActionDatasourcesExplore,
|
Action: ac.ActionDatasourcesExplore,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Action: ac.ActionDatasourcesDrilldown,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Grants: []string{string(org.RoleEditor)},
|
Grants: []string{string(org.RoleEditor)},
|
||||||
|
@ -183,7 +183,7 @@ func (hs *HTTPServer) registerRoutes() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
r.Get("/explore", authorize(ac.EvalPermission(ac.ActionDatasourcesExplore)), hs.Index)
|
r.Get("/explore", authorize(ac.EvalPermission(ac.ActionDatasourcesExplore)), hs.Index)
|
||||||
r.Get("/drilldown", authorize(ac.EvalPermission(ac.ActionDatasourcesDrilldown)), hs.Index)
|
r.Get("/drilldown", authorize(ac.EvalPermission(ac.ActionDatasourcesExplore)), hs.Index)
|
||||||
|
|
||||||
r.Get("/playlists/", reqSignedIn, hs.Index)
|
r.Get("/playlists/", reqSignedIn, hs.Index)
|
||||||
r.Get("/playlists/*", reqSignedIn, hs.Index)
|
r.Get("/playlists/*", reqSignedIn, hs.Index)
|
||||||
|
@ -386,8 +386,7 @@ const (
|
|||||||
ActionSettingsWrite = "settings:write"
|
ActionSettingsWrite = "settings:write"
|
||||||
|
|
||||||
// Datasources actions
|
// Datasources actions
|
||||||
ActionDatasourcesExplore = "datasources:explore"
|
ActionDatasourcesExplore = "datasources:explore"
|
||||||
ActionDatasourcesDrilldown = "datasources:drilldown"
|
|
||||||
|
|
||||||
// Global Scopes
|
// Global Scopes
|
||||||
ScopeGlobalUsersAll = "global.users:*"
|
ScopeGlobalUsersAll = "global.users:*"
|
||||||
|
@ -130,7 +130,7 @@ func (s *ServiceImpl) GetNavTree(c *contextmodel.ReqContext, prefs *pref.Prefere
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if hasAccess(ac.EvalPermission(ac.ActionDatasourcesDrilldown)) {
|
if hasAccess(ac.EvalPermission(ac.ActionDatasourcesExplore)) {
|
||||||
drilldownChildNavLinks := s.buildDrilldownNavLinks(c)
|
drilldownChildNavLinks := s.buildDrilldownNavLinks(c)
|
||||||
treeRoot.AddSection(&navtree.NavLink{
|
treeRoot.AddSection(&navtree.NavLink{
|
||||||
Text: "Drilldown",
|
Text: "Drilldown",
|
||||||
|
Reference in New Issue
Block a user