zitadel/internal/v2/repository/iam/policy_org_iam.go
2020-11-25 14:12:44 +01:00

28 lines
675 B
Go

package iam
import (
"github.com/caos/zitadel/internal/eventstore/v2"
"github.com/caos/zitadel/internal/v2/repository/policy"
)
var (
OrgIAMPolicyAddedEventType = iamEventTypePrefix + policy.OrgIAMPolicyAddedEventType
)
type OrgIAMPolicyReadModel struct{ policy.OrgIAMPolicyReadModel }
func (rm *OrgIAMPolicyReadModel) AppendEvents(events ...eventstore.EventReader) {
for _, event := range events {
switch e := event.(type) {
case *OrgIAMPolicyAddedEvent:
rm.ReadModel.AppendEvents(&e.OrgIAMPolicyAddedEvent)
case *policy.OrgIAMPolicyAddedEvent:
rm.ReadModel.AppendEvents(e)
}
}
}
type OrgIAMPolicyAddedEvent struct {
policy.OrgIAMPolicyAddedEvent
}