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:
idafurjes
2022-08-11 13:28:55 +02:00
committed by GitHub
parent ca72cd570e
commit a14621fff6
191 changed files with 1108 additions and 1049 deletions
+3 -3
View File
@@ -34,9 +34,9 @@ func (a *simpleSQLAuthService) getDashboardTableAuthFilter(user *user.SignedInUs
if a.ac.IsDisabled() {
return permissions.DashboardPermissionFilter{
OrgRole: user.OrgRole,
OrgId: user.OrgId,
OrgId: user.OrgID,
Dialect: a.sql.Dialect,
UserId: user.UserId,
UserId: user.UserID,
PermissionLevel: models.PERMISSION_VIEW,
}
}
@@ -52,7 +52,7 @@ func (a *simpleSQLAuthService) GetDashboardReadFilter(user *user.SignedInUser) (
sql, params := filter.Where()
sess.Table("dashboard").
Where(sql, params...).
Where("org_id = ?", user.OrgId).
Where("org_id = ?", user.OrgID).
Cols("uid")
err := sess.Find(&rows)
+1 -1
View File
@@ -132,7 +132,7 @@ func (s *StandardSearchService) getUser(ctx context.Context, backendUser *backen
}
usr = &user.SignedInUser{
OrgId: orga.Id,
OrgID: orga.Id,
OrgName: orga.Name,
OrgRole: org.RoleType(s.cfg.AnonymousOrgRole),
IsAnonymous: true,