mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Access Control: Get global role from request params (#84469)
This commit is contained in:
parent
da66f560a5
commit
f36ad469d0
@ -352,6 +352,15 @@ func UseGlobalOrgFromRequestData(c *contextmodel.ReqContext) (int64, error) {
|
||||
return c.SignedInUser.GetOrgID(), nil
|
||||
}
|
||||
|
||||
// UseGlobalOrgFromRequestParams returns global org if `global` flag is set or the org where user is logged in.
|
||||
func UseGlobalOrgFromRequestParams(c *contextmodel.ReqContext) (int64, error) {
|
||||
if c.QueryBool("global") {
|
||||
return GlobalOrgID, nil
|
||||
}
|
||||
|
||||
return c.SignedInUser.GetOrgID(), nil
|
||||
}
|
||||
|
||||
func getOrgQueryFromRequest(c *contextmodel.ReqContext) (*QueryWithOrg, error) {
|
||||
query := &QueryWithOrg{}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user