mirror of
https://github.com/grafana/grafana.git
synced 2025-01-06 14:13:11 -06:00
Access control: Fix listing data sources for org admins (#48961)
* Access control: Fix listing data sources for org admins * Access control: always list non-core plugins for org admins
This commit is contained in:
parent
75760e90b4
commit
4cd1a113ef
@ -38,7 +38,7 @@ func (hs *HTTPServer) GetPluginList(c *models.ReqContext) response.Response {
|
||||
// When using access control anyone that can create a data source should be able to list all data sources installed
|
||||
// Fallback to only letting admins list non-core plugins
|
||||
hasAccess := accesscontrol.HasAccess(hs.AccessControl, c)
|
||||
if !hasAccess(accesscontrol.ReqOrgAdmin, accesscontrol.EvalPermission(datasources.ActionCreate)) || c.HasRole(models.ROLE_ADMIN) {
|
||||
if !hasAccess(accesscontrol.ReqOrgAdmin, accesscontrol.EvalPermission(datasources.ActionCreate)) && !c.HasRole(models.ROLE_ADMIN) {
|
||||
coreFilter = "1"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user