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:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user