zitadel/internal/v2/repository/policy/org_iam.go

40 lines
714 B
Go
Raw Normal View History

2020-11-06 16:25:07 +00:00
package policy
import (
"context"
"github.com/caos/zitadel/internal/eventstore/v2"
)
const (
OrgIAMPolicyAddedEventType = "policy.org.iam.added"
)
type OrgIAMPolicyAddedEvent struct {
eventstore.BaseEvent `json:"-"`
UserLoginMustBeDomain bool `json:"allowUsernamePassword"`
}
func (e *OrgIAMPolicyAddedEvent) CheckPrevious() bool {
return true
}
func (e *OrgIAMPolicyAddedEvent) Data() interface{} {
return e
}
func NewOrgIAMPolicyAddedEvent(
ctx context.Context,
userLoginMustBeDomain bool,
) *OrgIAMPolicyAddedEvent {
return &OrgIAMPolicyAddedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
ctx,
OrgIAMPolicyAddedEventType,
),
UserLoginMustBeDomain: userLoginMustBeDomain,
}
}