mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06: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,6 +12,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/api/routing"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/services/auth"
|
||||
"github.com/grafana/grafana/pkg/services/org"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
"github.com/grafana/grafana/pkg/services/user/usertest"
|
||||
)
|
||||
@@ -161,7 +162,7 @@ func revokeUserAuthTokenScenario(t *testing.T, desc string, url string, routePat
|
||||
sc.context = c
|
||||
sc.context.UserId = userId
|
||||
sc.context.OrgId = testOrgID
|
||||
sc.context.OrgRole = models.ROLE_ADMIN
|
||||
sc.context.OrgRole = org.RoleAdmin
|
||||
|
||||
return hs.RevokeUserAuthToken(c)
|
||||
})
|
||||
@@ -187,7 +188,7 @@ func getUserAuthTokensScenario(t *testing.T, desc string, url string, routePatte
|
||||
sc.context = c
|
||||
sc.context.UserId = userId
|
||||
sc.context.OrgId = testOrgID
|
||||
sc.context.OrgRole = models.ROLE_ADMIN
|
||||
sc.context.OrgRole = org.RoleAdmin
|
||||
|
||||
return hs.GetUserAuthTokens(c)
|
||||
})
|
||||
@@ -210,7 +211,7 @@ func logoutUserFromAllDevicesInternalScenario(t *testing.T, desc string, userId
|
||||
sc.context = c
|
||||
sc.context.UserId = testUserID
|
||||
sc.context.OrgId = testOrgID
|
||||
sc.context.OrgRole = models.ROLE_ADMIN
|
||||
sc.context.OrgRole = org.RoleAdmin
|
||||
|
||||
return hs.logoutUserFromAllDevicesInternal(context.Background(), userId)
|
||||
})
|
||||
@@ -237,7 +238,7 @@ func revokeUserAuthTokenInternalScenario(t *testing.T, desc string, cmd models.R
|
||||
sc.context = c
|
||||
sc.context.UserId = testUserID
|
||||
sc.context.OrgId = testOrgID
|
||||
sc.context.OrgRole = models.ROLE_ADMIN
|
||||
sc.context.OrgRole = org.RoleAdmin
|
||||
sc.context.UserToken = token
|
||||
|
||||
return hs.revokeUserAuthTokenInternal(c, userId, cmd)
|
||||
@@ -262,7 +263,7 @@ func getUserAuthTokensInternalScenario(t *testing.T, desc string, token *models.
|
||||
sc.context = c
|
||||
sc.context.UserId = testUserID
|
||||
sc.context.OrgId = testOrgID
|
||||
sc.context.OrgRole = models.ROLE_ADMIN
|
||||
sc.context.OrgRole = org.RoleAdmin
|
||||
sc.context.UserToken = token
|
||||
|
||||
return hs.getUserAuthTokensInternal(c, testUserID)
|
||||
|
||||
Reference in New Issue
Block a user