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
@@ -11,9 +11,11 @@ import (
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/services/sqlstore/permissions"
"github.com/grafana/grafana/pkg/services/sqlstore/searchstore"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/util"
)
@@ -23,10 +25,10 @@ const (
)
func TestBuilder_EqualResults_Basic(t *testing.T) {
user := &models.SignedInUser{
user := &user.SignedInUser{
UserId: 1,
OrgId: 1,
OrgRole: models.ROLE_EDITOR,
OrgRole: org.RoleEditor,
}
db := setupTestEnvironment(t)
@@ -65,10 +67,10 @@ func TestBuilder_EqualResults_Basic(t *testing.T) {
}
func TestBuilder_Pagination(t *testing.T) {
user := &models.SignedInUser{
user := &user.SignedInUser{
UserId: 1,
OrgId: 1,
OrgRole: models.ROLE_VIEWER,
OrgRole: org.RoleViewer,
}
db := setupTestEnvironment(t)
@@ -111,10 +113,10 @@ func TestBuilder_Pagination(t *testing.T) {
}
func TestBuilder_Permissions(t *testing.T) {
user := &models.SignedInUser{
user := &user.SignedInUser{
UserId: 1,
OrgId: 1,
OrgRole: models.ROLE_VIEWER,
OrgRole: org.RoleViewer,
}
db := setupTestEnvironment(t)