ServiceAccounts: enable service accounts after IsRealUser change (#58263)

* suppor service accounts

* add: IsServiceAccount to scheduleUser in scheduler

Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>
This commit is contained in:
Ryan McKinley
2022-11-04 12:53:35 -07:00
committed by GitHub
parent d80abd173b
commit e6a9fa1cf9
3 changed files with 74 additions and 5 deletions

View File

@@ -328,11 +328,11 @@ func (sch *schedule) ruleRoutine(grafanaCtx context.Context, key ngmodels.AlertR
start := sch.clock.Now()
schedulerUser := &user.SignedInUser{
// FIXME: add is service account and refactor to a service account instead of a user
UserID: -1,
Login: "grafana_scheduler",
OrgID: e.rule.OrgID,
OrgRole: org.RoleAdmin,
UserID: -1,
IsServiceAccount: true,
Login: "grafana_scheduler",
OrgID: e.rule.OrgID,
OrgRole: org.RoleAdmin,
Permissions: map[int64]map[string][]string{
e.rule.OrgID: {
datasources.ActionQuery: []string{