Merge commit from fork

This commit is contained in:
Livio Spring
2026-02-25 06:34:17 +01:00
committed by GitHub
parent b2532e9666
commit 0261536243
3 changed files with 112 additions and 1 deletions
+3 -1
View File
@@ -297,7 +297,9 @@ func (c *Commands) ChangeUserHuman(ctx context.Context, human *ChangeHuman, alg
}
if human.Changed() {
if err := c.checkPermissionUpdateUser(ctx, existingHuman.ResourceOwner, existingHuman.AggregateID, !metadataChanged); err != nil {
// Changing metadata or setting email, resp. phone to verified is only allowed with user write permissions, but not for self-management.
requireWritePermission := metadataChanged || (human.Email != nil && human.Email.Verified) || (human.Phone != nil && human.Phone.Verified)
if err := c.checkPermissionUpdateUser(ctx, existingHuman.ResourceOwner, existingHuman.AggregateID, !requireWritePermission); err != nil {
return err
}
}