[v11.2.x] Identity: remove GetTypedID (#92256)
Identity: remove GetTypedID (#91745)
(cherry picked from commit bcfb66b416)
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
This commit is contained in:
co-authored by
Karl Persson
parent
7a25060fa6
commit
811307c46b
+12
-12
@@ -22,9 +22,9 @@ func (hs *HTTPServer) SetHomeDashboard(c *contextmodel.ReqContext) response.Resp
|
||||
return response.Error(http.StatusBadRequest, "bad request data", err)
|
||||
}
|
||||
|
||||
userID, errID := identity.UserIdentifier(c.SignedInUser.GetTypedID())
|
||||
if errID != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to set home dashboard", errID)
|
||||
userID, err := identity.UserIdentifier(c.SignedInUser.GetID())
|
||||
if err != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to set home dashboard", err)
|
||||
}
|
||||
|
||||
cmd.UserID = userID
|
||||
@@ -64,9 +64,9 @@ func (hs *HTTPServer) SetHomeDashboard(c *contextmodel.ReqContext) response.Resp
|
||||
// 401: unauthorisedError
|
||||
// 500: internalServerError
|
||||
func (hs *HTTPServer) GetUserPreferences(c *contextmodel.ReqContext) response.Response {
|
||||
userID, errID := identity.UserIdentifier(c.SignedInUser.GetTypedID())
|
||||
if errID != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to get user preferences", errID)
|
||||
userID, err := identity.UserIdentifier(c.SignedInUser.GetID())
|
||||
if err != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to update user preferences", err)
|
||||
}
|
||||
|
||||
return prefapi.GetPreferencesFor(c.Req.Context(), hs.DashboardService, hs.preferenceService, c.SignedInUser.GetOrgID(), userID, 0)
|
||||
@@ -89,9 +89,9 @@ func (hs *HTTPServer) UpdateUserPreferences(c *contextmodel.ReqContext) response
|
||||
return response.Error(http.StatusBadRequest, "bad request data", err)
|
||||
}
|
||||
|
||||
userID, errID := identity.UserIdentifier(c.SignedInUser.GetTypedID())
|
||||
if errID != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to update user preferences", errID)
|
||||
userID, err := identity.UserIdentifier(c.SignedInUser.GetID())
|
||||
if err != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to update user preferences", err)
|
||||
}
|
||||
|
||||
return prefapi.UpdatePreferencesFor(c.Req.Context(), hs.DashboardService,
|
||||
@@ -113,9 +113,9 @@ func (hs *HTTPServer) PatchUserPreferences(c *contextmodel.ReqContext) response.
|
||||
return response.Error(http.StatusBadRequest, "bad request data", err)
|
||||
}
|
||||
|
||||
userID, errID := identity.UserIdentifier(c.SignedInUser.GetTypedID())
|
||||
if errID != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to update user preferences", errID)
|
||||
userID, err := identity.UserIdentifier(c.SignedInUser.GetID())
|
||||
if err != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to update user preferences", err)
|
||||
}
|
||||
|
||||
return hs.patchPreferencesFor(c.Req.Context(), c.SignedInUser.GetOrgID(), userID, 0, &dtoCmd)
|
||||
|
||||
Reference in New Issue
Block a user