RBAC: Check plugins:install globally (#78438)

* RBAC: Check plugins:install globally

* Add disclamer to the RBACSingleOrganization config option
This commit is contained in:
Gabriel MABILLE
2023-11-21 15:09:43 +01:00
committed by GitHub
parent 9e11779921
commit b6b86bb0b3
6 changed files with 38 additions and 13 deletions
+10
View File
@@ -252,6 +252,16 @@ func UseGlobalOrg(c *contextmodel.ReqContext) (int64, error) {
return GlobalOrgID, nil
}
// UseGlobalOrSingleOrg returns the global organization or the current organization in a single organization setup
func UseGlobalOrSingleOrg(cfg *setting.Cfg) OrgIDGetter {
return func(c *contextmodel.ReqContext) (int64, error) {
if cfg.RBACSingleOrganization {
return c.GetOrgID(), nil
}
return GlobalOrgID, nil
}
}
// scopeParams holds the parameters used to fill in scope templates
type scopeParams struct {
OrgID int64