feat: listen to user life cycle events
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -335,6 +335,41 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Permanently remove all document data owned by the initialized user.
|
||||
*/
|
||||
public function destroy(): void {
|
||||
foreach ($this->entityListBulk(null) as $entity) {
|
||||
$identifier = $entity->identifier();
|
||||
if ($identifier === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->entityDelete(new EntityIdentifier(
|
||||
$entity->provider(),
|
||||
(string) $entity->service(),
|
||||
(string) $entity->collection(),
|
||||
(string) $identifier,
|
||||
));
|
||||
}
|
||||
|
||||
foreach ($this->collectionList(null) as $collection) {
|
||||
$identifier = $collection->identifier();
|
||||
if ($identifier === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->collectionDelete(new CollectionIdentifier(
|
||||
$collection->provider(),
|
||||
(string) $collection->service(),
|
||||
(string) $identifier,
|
||||
), true);
|
||||
}
|
||||
|
||||
$this->metaStore->chronicleExpungeByUser($this->serviceTenantId, $this->serviceUserId);
|
||||
$this->blobStore->rootDestroy();
|
||||
}
|
||||
|
||||
public function collectionCopy(CollectionIdentifierInterface|null $target, CollectionIdentifierInterface $source): CollectionResource {
|
||||
$identifier = $source->collection();
|
||||
// Protect root collection
|
||||
|
||||
Reference in New Issue
Block a user