mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 17:42:12 +08:00
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:
@ -12,12 +12,13 @@ import (
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||
"github.com/grafana/grafana/pkg/services/dashboards"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
)
|
||||
|
||||
func TestHTTPServer_Search(t *testing.T) {
|
||||
sc := setupHTTPServer(t, true, true)
|
||||
sc.initCtx.IsSignedIn = true
|
||||
sc.initCtx.SignedInUser = &models.SignedInUser{}
|
||||
sc.initCtx.SignedInUser = &user.SignedInUser{}
|
||||
|
||||
sc.hs.SearchService = &mockSearchService{
|
||||
ExpectedResult: models.HitList{
|
||||
@ -27,7 +28,7 @@ func TestHTTPServer_Search(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
sc.acmock.GetUserPermissionsFunc = func(ctx context.Context, user *models.SignedInUser, options accesscontrol.Options) ([]accesscontrol.Permission, error) {
|
||||
sc.acmock.GetUserPermissionsFunc = func(ctx context.Context, user *user.SignedInUser, options accesscontrol.Options) ([]accesscontrol.Permission, error) {
|
||||
return []accesscontrol.Permission{
|
||||
{Action: "folders:read", Scope: "folders:*"},
|
||||
{Action: "folders:write", Scope: "folders:uid:folder2"},
|
||||
|
Reference in New Issue
Block a user