RBAC: GrafanaAdmin users are admins of the Global Organization (#78559)

This commit is contained in:
Gabriel MABILLE 2023-11-23 12:17:28 +01:00 committed by GitHub
parent 5355131aed
commit 91a5c3803c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -365,6 +365,10 @@ func GetOrgRoles(user identity.Requester) []string {
roles := []string{string(user.GetOrgRole())}
if user.GetIsGrafanaAdmin() {
if user.GetOrgID() == GlobalOrgID {
// A server admin is the admin of the global organization
return []string{RoleGrafanaAdmin, string(org.RoleAdmin)}
}
roles = append(roles, RoleGrafanaAdmin)
}