Move SignedInUser to user service and RoleType and Roles to org (#53445)

* Move SignedInUser to user service and RoleType and Roles to org

* Use go naming convention for roles

* Fix some imports and leftovers

* Fix ldap debug test

* Fix lint

* Fix lint 2

* Fix lint 3

* Fix type and not needed conversion

* Clean up messages in api tests

* Clean up api tests 2
This commit is contained in:
idafurjes
2022-08-10 11:56:48 +02:00
committed by GitHub
parent 46004037e2
commit 6afad51761
278 changed files with 1758 additions and 1543 deletions
+4 -3
View File
@@ -9,7 +9,6 @@ import (
prometheusModel "github.com/prometheus/common/model"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/alerting"
"github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
"github.com/grafana/grafana/pkg/services/ngalert/eval"
@@ -17,6 +16,8 @@ import (
ngmodels "github.com/grafana/grafana/pkg/services/ngalert/models"
"github.com/grafana/grafana/pkg/services/ngalert/state"
"github.com/grafana/grafana/pkg/services/ngalert/store"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
"github.com/benbjohnson/clock"
@@ -468,9 +469,9 @@ func (sch *schedule) getRuleExtraLabels(ctx context.Context, alertRule *ngmodels
extraLabels[prometheusModel.AlertNameLabel] = alertRule.Title
extraLabels[ngmodels.RuleUIDLabel] = alertRule.UID
user := &models.SignedInUser{
user := &user.SignedInUser{
UserId: 0,
OrgRole: models.ROLE_ADMIN,
OrgRole: org.RoleAdmin,
OrgId: alertRule.OrgID,
}