mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 07:07:32 +00:00
fix: new es bug fixes (#1477)
* fix: displayname on members * fix: user grant update * fix: user grant id * console grantid Co-authored-by: Max Peintner <max@caos.ch>
This commit is contained in:
@@ -79,14 +79,9 @@ func (c *Commands) changeUserGrant(ctx context.Context, userGrant *domain.UserGr
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if !userGrant.IsValid() || userGrant.AggregateID == "" {
|
||||
if userGrant.AggregateID == "" {
|
||||
return nil, nil, caos_errs.ThrowInvalidArgument(nil, "COMMAND-3M0sd", "Errors.UserGrant.Invalid")
|
||||
}
|
||||
|
||||
err = c.checkUserGrantPreCondition(ctx, userGrant)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
existingUserGrant, err := c.userGrantWriteModelByID(ctx, userGrant.AggregateID, userGrant.ResourceOwner)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
@@ -97,6 +92,10 @@ func (c *Commands) changeUserGrant(ctx context.Context, userGrant *domain.UserGr
|
||||
if reflect.DeepEqual(existingUserGrant.RoleKeys, userGrant.RoleKeys) {
|
||||
return nil, nil, caos_errs.ThrowPreconditionFailed(nil, "COMMAND-Rs8fy", "Errors.UserGrant.NotChanged")
|
||||
}
|
||||
err = c.checkUserGrantPreCondition(ctx, userGrantWriteModelToUserGrant(existingUserGrant))
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
changedUserGrant := NewUserGrantWriteModel(userGrant.AggregateID, resourceOwner)
|
||||
userGrantAgg := UserGrantAggregateFromWriteModel(&changedUserGrant.WriteModel)
|
||||
|
Reference in New Issue
Block a user