[management] explicit accountID check when deleting a user (#6944)

This commit is contained in:
Pascal Fischer
2026-07-28 18:34:55 +02:00
committed by GitHub
parent 44fef45c2f
commit dd2bdc0de3
2 changed files with 50 additions and 0 deletions
+4
View File
@@ -321,6 +321,10 @@ func (am *DefaultAccountManager) DeleteUser(ctx context.Context, accountID, init
return err
}
if targetUser.AccountID != accountID {
return status.NewUserNotFoundError(targetUserID)
}
if targetUser.Role == types.UserRoleOwner {
return status.NewOwnerDeletePermissionError()
}