mirror of
https://github.com/grafana/grafana.git
synced 2026-08-18 17:15:08 -05:00
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:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user