mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 20:08:02 +00:00
40 lines
714 B
Go
40 lines
714 B
Go
|
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,
|
||
|
}
|
||
|
}
|