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
+6 -5
View File
@@ -12,6 +12,7 @@ import (
"github.com/grafana/grafana/pkg/models"
acmock "github.com/grafana/grafana/pkg/services/accesscontrol/mock"
"github.com/grafana/grafana/pkg/services/dashboardimport"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/web/webtest"
"github.com/stretchr/testify/require"
)
@@ -50,7 +51,7 @@ func TestImportDashboardAPI(t *testing.T) {
jsonBytes, err := json.Marshal(cmd)
require.NoError(t, err)
req := s.NewPostRequest("/api/dashboards/import", bytes.NewReader(jsonBytes))
webtest.RequestWithSignedInUser(req, &models.SignedInUser{
webtest.RequestWithSignedInUser(req, &user.SignedInUser{
UserId: 1,
})
resp, err := s.SendJSON(req)
@@ -66,7 +67,7 @@ func TestImportDashboardAPI(t *testing.T) {
jsonBytes, err := json.Marshal(cmd)
require.NoError(t, err)
req := s.NewPostRequest("/api/dashboards/import", bytes.NewReader(jsonBytes))
webtest.RequestWithSignedInUser(req, &models.SignedInUser{
webtest.RequestWithSignedInUser(req, &user.SignedInUser{
UserId: 1,
})
resp, err := s.SendJSON(req)
@@ -83,7 +84,7 @@ func TestImportDashboardAPI(t *testing.T) {
jsonBytes, err := json.Marshal(cmd)
require.NoError(t, err)
req := s.NewPostRequest("/api/dashboards/import?trimdefaults=true", bytes.NewReader(jsonBytes))
webtest.RequestWithSignedInUser(req, &models.SignedInUser{
webtest.RequestWithSignedInUser(req, &user.SignedInUser{
UserId: 1,
})
resp, err := s.SendJSON(req)
@@ -115,7 +116,7 @@ func TestImportDashboardAPI(t *testing.T) {
jsonBytes, err := json.Marshal(cmd)
require.NoError(t, err)
req := s.NewPostRequest("/api/dashboards/import?trimdefaults=true", bytes.NewReader(jsonBytes))
webtest.RequestWithSignedInUser(req, &models.SignedInUser{
webtest.RequestWithSignedInUser(req, &user.SignedInUser{
UserId: 1,
})
resp, err := s.SendJSON(req)
@@ -141,7 +142,7 @@ func TestImportDashboardAPI(t *testing.T) {
jsonBytes, err := json.Marshal(cmd)
require.NoError(t, err)
req := s.NewPostRequest("/api/dashboards/import", bytes.NewReader(jsonBytes))
webtest.RequestWithSignedInUser(req, &models.SignedInUser{
webtest.RequestWithSignedInUser(req, &user.SignedInUser{
UserId: 1,
})
resp, err := s.SendJSON(req)