Undelete: deleted accounts are kept for their period, hold their addresses, and are restored or destroyed through inbuxa:DeletedAccount (UD-15 to UD-17a)
With archiveDeletedAccountsFor set, a destroyed account's record is kept in the fork subspace with its id, its DestroyAccount task is due at the end of the period, and its shares are suspended both ways. Its addresses can't be taken by new accounts, aliases, lists or masks. inbuxa:DeletedAccount/get lists kept accounts to server and tenant administrators; /set restores one with a new password (same id, task cancelled, shares reinstated) or destroys it now. The destroy task also clears undelete's own records. Acceptance test 14; test 16 written as the ignored undelete_compat.
This commit is contained in:
@@ -572,6 +572,14 @@ impl RegistrySet for Server {
|
||||
}
|
||||
};
|
||||
|
||||
// inbuxa: UD-16: a kept account's addresses stay its own
|
||||
if let Some(err) =
|
||||
crate::inbuxa::deleted_account::reserved(self, stored, &new_object).await?
|
||||
{
|
||||
set.failed(modification, err);
|
||||
continue 'outer;
|
||||
}
|
||||
|
||||
// Validate expressions
|
||||
if let Some(expressions) = new_object.inner.expression_ctxs() {
|
||||
let mut bp = Bootstrap::new_uninitialized(self.registry().clone());
|
||||
@@ -750,7 +758,17 @@ impl RegistrySet for Server {
|
||||
.await?
|
||||
{
|
||||
RegistryWriteResult::Success(_) => {
|
||||
if let ObjectInner::Account(account) = &object.inner {
|
||||
// inbuxa: UD-15, UD-17a: kept for its period, shares suspended
|
||||
if let ObjectInner::Account(account) = &object.inner
|
||||
&& let Some(others) =
|
||||
crate::inbuxa::deleted_account::keep(self, id, account)
|
||||
.await?
|
||||
{
|
||||
for other in others {
|
||||
cache_invalidator
|
||||
.invalidate(CacheInvalidation::AccessToken(other));
|
||||
}
|
||||
} else if let ObjectInner::Account(account) = &object.inner {
|
||||
for sharee_id in self
|
||||
.store()
|
||||
.acl_revoke_all(id.document_id())
|
||||
@@ -837,6 +855,7 @@ impl RegistrySet for Server {
|
||||
Ok(set.into_response())
|
||||
}
|
||||
#[cfg(not(feature = "enterprise"))]
|
||||
#[allow(unreachable_patterns)] // inbuxa: ArchivedItem was the last one
|
||||
_ => {
|
||||
set.fail_all_create("Enterprise objects cannot be created");
|
||||
set.fail_all_update("Enterprise objects cannot be modified");
|
||||
|
||||
Reference in New Issue
Block a user