zitadel/internal/command/setup_step20.go
Fabi 9d4f296c62
fix: rename iam to instance (#3345)
* fix: rename iam command side to instance

* fix: rename iam command side to instance

* fix: rename iam command side to instance

* fix: rename iam command side to instance

* fix: rename orgiampolicy to domain policy

* fix: merge conflicts

* fix: protos

* fix: md files

* implement deprecated org iam policy again

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
2022-03-24 16:21:34 +00:00

27 lines
609 B
Go

package command
import (
"context"
"github.com/caos/zitadel/internal/domain"
"github.com/caos/zitadel/internal/eventstore"
)
type Step20 struct{}
func (s *Step20) Step() domain.Step {
return domain.Step20
}
func (s *Step20) execute(ctx context.Context, commandSide *Commands) error {
return commandSide.SetupStep20(ctx, s)
}
func (c *Commands) SetupStep20(ctx context.Context, step *Step20) error {
fn := func(iam *InstanceWriteModel) ([]eventstore.Command, error) {
err := c.eventstore.Step20(ctx, iam.Events[len(iam.Events)-1].Sequence())
return nil, err
}
return c.setup(ctx, step, fn)
}