mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 11:34:26 +00:00
fix: ensure resource owner in update human profile (#6253)
This commit is contained in:
parent
cedf4dda5b
commit
13e284dd56
@ -421,7 +421,7 @@ func (s *Server) GetHumanProfile(ctx context.Context, req *mgmt_pb.GetHumanProfi
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) UpdateHumanProfile(ctx context.Context, req *mgmt_pb.UpdateHumanProfileRequest) (*mgmt_pb.UpdateHumanProfileResponse, error) {
|
func (s *Server) UpdateHumanProfile(ctx context.Context, req *mgmt_pb.UpdateHumanProfileRequest) (*mgmt_pb.UpdateHumanProfileResponse, error) {
|
||||||
profile, err := s.command.ChangeHumanProfile(ctx, UpdateHumanProfileRequestToDomain(req))
|
profile, err := s.command.ChangeHumanProfile(ctx, UpdateHumanProfileRequestToDomain(req, authz.GetCtxData(ctx).OrgID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -146,11 +146,11 @@ func AddMachineUserRequestToCommand(req *mgmt_pb.AddMachineUserRequest, resource
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func UpdateHumanProfileRequestToDomain(req *mgmt_pb.UpdateHumanProfileRequest) *domain.Profile {
|
func UpdateHumanProfileRequestToDomain(req *mgmt_pb.UpdateHumanProfileRequest, orgID string) *domain.Profile {
|
||||||
preferredLanguage, err := language.Parse(req.PreferredLanguage)
|
preferredLanguage, err := language.Parse(req.PreferredLanguage)
|
||||||
logging.Log("MANAG-GPcYv").OnError(err).Debug("language malformed")
|
logging.Log("MANAG-GPcYv").OnError(err).Debug("language malformed")
|
||||||
return &domain.Profile{
|
return &domain.Profile{
|
||||||
ObjectRoot: models.ObjectRoot{AggregateID: req.UserId},
|
ObjectRoot: models.ObjectRoot{AggregateID: req.UserId, ResourceOwner: orgID},
|
||||||
FirstName: req.FirstName,
|
FirstName: req.FirstName,
|
||||||
LastName: req.LastName,
|
LastName: req.LastName,
|
||||||
NickName: req.NickName,
|
NickName: req.NickName,
|
||||||
|
Loading…
Reference in New Issue
Block a user