Chore: Add user service method SetUsingOrg and GetSignedInUserWithCacheCtx (#53343)
* Chore: Add user service method SetUsingOrg * Chore: Add user service method GetSignedInUserWithCacheCtx * Use method GetSignedInUserWithCacheCtx from user service * Fix lint after rebase * Fix lint * Fix lint error * roll back some changes * Roll back changes in api and middleware * Add xorm tags to SignedInUser ID fields
This commit is contained in:
+10
-10
@@ -160,8 +160,8 @@ func revokeUserAuthTokenScenario(t *testing.T, desc string, url string, routePat
|
||||
sc.defaultHandler = routing.Wrap(func(c *models.ReqContext) response.Response {
|
||||
c.Req.Body = mockRequestBody(cmd)
|
||||
sc.context = c
|
||||
sc.context.UserId = userId
|
||||
sc.context.OrgId = testOrgID
|
||||
sc.context.UserID = userId
|
||||
sc.context.OrgID = testOrgID
|
||||
sc.context.OrgRole = org.RoleAdmin
|
||||
|
||||
return hs.RevokeUserAuthToken(c)
|
||||
@@ -186,8 +186,8 @@ func getUserAuthTokensScenario(t *testing.T, desc string, url string, routePatte
|
||||
sc.userAuthTokenService = fakeAuthTokenService
|
||||
sc.defaultHandler = routing.Wrap(func(c *models.ReqContext) response.Response {
|
||||
sc.context = c
|
||||
sc.context.UserId = userId
|
||||
sc.context.OrgId = testOrgID
|
||||
sc.context.UserID = userId
|
||||
sc.context.OrgID = testOrgID
|
||||
sc.context.OrgRole = org.RoleAdmin
|
||||
|
||||
return hs.GetUserAuthTokens(c)
|
||||
@@ -209,8 +209,8 @@ func logoutUserFromAllDevicesInternalScenario(t *testing.T, desc string, userId
|
||||
sc := setupScenarioContext(t, "/")
|
||||
sc.defaultHandler = routing.Wrap(func(c *models.ReqContext) response.Response {
|
||||
sc.context = c
|
||||
sc.context.UserId = testUserID
|
||||
sc.context.OrgId = testOrgID
|
||||
sc.context.UserID = testUserID
|
||||
sc.context.OrgID = testOrgID
|
||||
sc.context.OrgRole = org.RoleAdmin
|
||||
|
||||
return hs.logoutUserFromAllDevicesInternal(context.Background(), userId)
|
||||
@@ -236,8 +236,8 @@ func revokeUserAuthTokenInternalScenario(t *testing.T, desc string, cmd models.R
|
||||
sc.userAuthTokenService = fakeAuthTokenService
|
||||
sc.defaultHandler = routing.Wrap(func(c *models.ReqContext) response.Response {
|
||||
sc.context = c
|
||||
sc.context.UserId = testUserID
|
||||
sc.context.OrgId = testOrgID
|
||||
sc.context.UserID = testUserID
|
||||
sc.context.OrgID = testOrgID
|
||||
sc.context.OrgRole = org.RoleAdmin
|
||||
sc.context.UserToken = token
|
||||
|
||||
@@ -261,8 +261,8 @@ func getUserAuthTokensInternalScenario(t *testing.T, desc string, token *models.
|
||||
sc.userAuthTokenService = fakeAuthTokenService
|
||||
sc.defaultHandler = routing.Wrap(func(c *models.ReqContext) response.Response {
|
||||
sc.context = c
|
||||
sc.context.UserId = testUserID
|
||||
sc.context.OrgId = testOrgID
|
||||
sc.context.UserID = testUserID
|
||||
sc.context.OrgID = testOrgID
|
||||
sc.context.OrgRole = org.RoleAdmin
|
||||
sc.context.UserToken = token
|
||||
|
||||
|
||||
Reference in New Issue
Block a user