Fix Registry: Changing the type of an existing account from user to group panics

This commit is contained in:
Maurus Decimus
2026-06-28 19:10:00 +02:00
parent 7e7e254328
commit 5f58fdb92b
2 changed files with 9 additions and 1 deletions

View File

@@ -245,7 +245,14 @@ pub(crate) async fn validate_account(
true
}
_ => unreachable!(),
(Account::User(_), AccountUpdate::Update(Account::Group(_)))
| (Account::Group(_), AccountUpdate::Update(Account::User(_))) => {
return Ok(Err(SetError::invalid_properties()
.with_property(Property::Type)
.with_description(
"Cannot change the type of an existing account.",
)));
}
};
let mut result = if validate_permissions {