mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Add org_id in join (#43648)
This commit is contained in:
@@ -264,16 +264,16 @@ func getResourcesPermissions(sess *sqlstore.DBSession, orgID int64, query access
|
|||||||
INNER JOIN role r ON p.role_id = r.id
|
INNER JOIN role r ON p.role_id = r.id
|
||||||
`
|
`
|
||||||
userFrom := rawFrom + `
|
userFrom := rawFrom + `
|
||||||
INNER JOIN user_role ur ON r.id = ur.role_id
|
INNER JOIN user_role ur ON r.id = ur.role_id AND (ur.org_id = 0 OR ur.org_id = ?)
|
||||||
INNER JOIN user u ON ur.user_id = u.id
|
INNER JOIN user u ON ur.user_id = u.id
|
||||||
`
|
`
|
||||||
teamFrom := rawFrom + `
|
teamFrom := rawFrom + `
|
||||||
INNER JOIN team_role tr ON r.id = tr.role_id
|
INNER JOIN team_role tr ON r.id = tr.role_id AND (tr.org_id = 0 OR tr.org_id = ?)
|
||||||
INNER JOIN team t ON tr.team_id = t.id
|
INNER JOIN team t ON tr.team_id = t.id
|
||||||
`
|
`
|
||||||
|
|
||||||
builtinFrom := rawFrom + `
|
builtinFrom := rawFrom + `
|
||||||
INNER JOIN builtin_role br ON r.id = br.role_id
|
INNER JOIN builtin_role br ON r.id = br.role_id AND (br.org_id = 0 OR br.org_id = ?)
|
||||||
`
|
`
|
||||||
where := `
|
where := `
|
||||||
WHERE (r.org_id = ? OR r.org_id = 0)
|
WHERE (r.org_id = ? OR r.org_id = 0)
|
||||||
@@ -286,6 +286,7 @@ func getResourcesPermissions(sess *sqlstore.DBSession, orgID int64, query access
|
|||||||
}
|
}
|
||||||
|
|
||||||
args := []interface{}{
|
args := []interface{}{
|
||||||
|
orgID,
|
||||||
orgID,
|
orgID,
|
||||||
accesscontrol.GetResourceAllScope(query.Resource),
|
accesscontrol.GetResourceAllScope(query.Resource),
|
||||||
accesscontrol.GetResourceAllIDScope(query.Resource),
|
accesscontrol.GetResourceAllIDScope(query.Resource),
|
||||||
|
|||||||
Reference in New Issue
Block a user