Identity: Unfurl OrgID in pkg/services to allow using identity.Requester interface (#76113)

Unfurl OrgID in pkg/services to allow using identity.Requester interface
This commit is contained in:
Jo
2023-10-09 10:40:19 +02:00
committed by GitHub
parent 20d64705f5
commit dcd0c6b11e
19 changed files with 100 additions and 98 deletions

View File

@@ -48,7 +48,7 @@ func (s *CorrelationsService) createHandler(c *contextmodel.ReqContext) response
return response.Error(http.StatusBadRequest, "bad request data", err)
}
cmd.SourceUID = web.Params(c.Req)[":uid"]
cmd.OrgId = c.OrgID
cmd.OrgId = c.SignedInUser.GetOrgID()
correlation, err := s.CreateCorrelation(c.Req.Context(), cmd)
if err != nil {
@@ -91,7 +91,7 @@ func (s *CorrelationsService) deleteHandler(c *contextmodel.ReqContext) response
cmd := DeleteCorrelationCommand{
UID: web.Params(c.Req)[":correlationUID"],
SourceUID: web.Params(c.Req)[":uid"],
OrgId: c.OrgID,
OrgId: c.SignedInUser.GetOrgID(),
}
err := s.DeleteCorrelation(c.Req.Context(), cmd)
@@ -153,7 +153,7 @@ func (s *CorrelationsService) updateHandler(c *contextmodel.ReqContext) response
cmd.UID = web.Params(c.Req)[":correlationUID"]
cmd.SourceUID = web.Params(c.Req)[":uid"]
cmd.OrgId = c.OrgID
cmd.OrgId = c.SignedInUser.GetOrgID()
correlation, err := s.UpdateCorrelation(c.Req.Context(), cmd)
if err != nil {
@@ -206,7 +206,7 @@ func (s *CorrelationsService) getCorrelationHandler(c *contextmodel.ReqContext)
query := GetCorrelationQuery{
UID: web.Params(c.Req)[":correlationUID"],
SourceUID: web.Params(c.Req)[":uid"],
OrgId: c.OrgID,
OrgId: c.SignedInUser.GetOrgID(),
}
correlation, err := s.getCorrelation(c.Req.Context(), query)
@@ -252,7 +252,7 @@ type GetCorrelationResponse struct {
func (s *CorrelationsService) getCorrelationsBySourceUIDHandler(c *contextmodel.ReqContext) response.Response {
query := GetCorrelationsBySourceUIDQuery{
SourceUID: web.Params(c.Req)[":uid"],
OrgId: c.OrgID,
OrgId: c.SignedInUser.GetOrgID(),
}
correlations, err := s.getCorrelationsBySourceUID(c.Req.Context(), query)
@@ -308,7 +308,7 @@ func (s *CorrelationsService) getCorrelationsHandler(c *contextmodel.ReqContext)
sourceUIDs := c.QueryStrings("sourceUID")
query := GetCorrelationsQuery{
OrgId: c.OrgID,
OrgId: c.SignedInUser.GetOrgID(),
Limit: limit,
Page: page,
SourceUIDs: sourceUIDs,