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
+2 -1
View File
@@ -7,6 +7,7 @@ import (
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/services/star"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/models"
@@ -30,7 +31,7 @@ type Query struct {
Title string
Tags []string
OrgId int64
SignedInUser *models.SignedInUser
SignedInUser *user.SignedInUser
Limit int64
Page int64
IsStarred bool
+3 -2
View File
@@ -13,6 +13,7 @@ import (
"github.com/grafana/grafana/pkg/services/sqlstore/mockstore"
"github.com/grafana/grafana/pkg/services/star"
"github.com/grafana/grafana/pkg/services/star/startest"
"github.com/grafana/grafana/pkg/services/user"
)
func TestSearch_SortedResults(t *testing.T) {
@@ -29,7 +30,7 @@ func TestSearch_SortedResults(t *testing.T) {
&models.Hit{ID: 17, Title: "FOLDER", Type: "dash-folder"},
}
}).Return(nil)
ms.ExpectedSignedInUser = &models.SignedInUser{IsGrafanaAdmin: true}
ms.ExpectedSignedInUser = &user.SignedInUser{IsGrafanaAdmin: true}
ss.ExpectedUserStars = &star.GetUserStarsResult{UserStars: map[int64]bool{10: true, 12: true}}
svc := &SearchService{
sqlstore: ms,
@@ -39,7 +40,7 @@ func TestSearch_SortedResults(t *testing.T) {
query := &Query{
Limit: 2000,
SignedInUser: &models.SignedInUser{
SignedInUser: &user.SignedInUser{
IsGrafanaAdmin: true,
},
}