diff --git a/internal/project/repository/eventsourcing/model/project.go b/internal/project/repository/eventsourcing/model/project.go index bdf133c300..f360f6429e 100644 --- a/internal/project/repository/eventsourcing/model/project.go +++ b/internal/project/repository/eventsourcing/model/project.go @@ -168,7 +168,7 @@ func (p *Project) AppendEvent(event *es_models.Event) error { } func (p *Project) AppendAddProjectEvent(event *es_models.Event) error { - p.setData(event) + p.SetData(event) p.State = int32(model.ProjectStateActive) return nil } @@ -188,7 +188,7 @@ func (p *Project) appendRemovedEvent() error { return nil } -func (p *Project) setData(event *es_models.Event) error { +func (p *Project) SetData(event *es_models.Event) error { if err := json.Unmarshal(event.Data, p); err != nil { logging.Log("EVEN-lo9sr").WithError(err).Error("could not unmarshal event data") return err diff --git a/internal/project/repository/view/model/application.go b/internal/project/repository/view/model/application.go index fe682d8f02..105326666c 100644 --- a/internal/project/repository/view/model/application.go +++ b/internal/project/repository/view/model/application.go @@ -179,7 +179,10 @@ func (a *ApplicationView) AppendEvent(event *models.Event) (err error) { case es_model.APIConfigChanged: return a.SetData(event) case es_model.ProjectChanged: - return a.SetData(event) + project := &es_model.Project{} + project.SetData(event) + a.ProjectRoleAssertion = project.ProjectRoleAssertion + a.ProjectRoleCheck = project.ProjectRoleAssertion case es_model.ApplicationDeactivated: a.State = int32(model.AppStateInactive) case es_model.ApplicationReactivated: