fix: correct event type for permission removed (#9626)

# Which Problems Are Solved

When we recently changed some permission for the `SYSTEM_OWNER` role on
QA, we noticed that there we multiple `permission.added` even when we
removed specific permissions.

# How the Problems Are Solved

Fixed the event type when removing permissions.

# Additional Changes

None

# Additional Context

Noticed when rolling out some changes on QA
This commit is contained in:
Livio Spring 2025-03-24 18:00:44 +01:00 committed by GitHub
parent 54e513f312
commit e7c7f9b800
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -99,7 +99,7 @@ func (e *RemovedEvent) Fields() []*eventstore.FieldOperation {
func NewRemovedEvent(ctx context.Context, aggregate *eventstore.Aggregate, role, permission string) *RemovedEvent { func NewRemovedEvent(ctx context.Context, aggregate *eventstore.Aggregate, role, permission string) *RemovedEvent {
return &RemovedEvent{ return &RemovedEvent{
BaseEvent: eventstore.NewBaseEventForPush(ctx, aggregate, AddedType), BaseEvent: eventstore.NewBaseEventForPush(ctx, aggregate, RemovedType),
Role: role, Role: role,
Permission: permission, Permission: permission,
} }