diff options
author | binsky <timo@binsky.org> | 2021-03-22 22:10:00 +0300 |
---|---|---|
committer | binsky <timo@binsky.org> | 2021-03-22 22:10:00 +0300 |
commit | 80d76f469727b3c11b8f722c79fbf394231923c3 (patch) | |
tree | a6c33056571653c9da67b70c6ea97fa882f8fc8e | |
parent | 74a23d08c279c59a16e503ea8392a9f25ff1ca78 (diff) |
verify that deleting a credential will delete all related shares; fix #664
-rw-r--r-- | lib/Service/CredentialService.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Service/CredentialService.php b/lib/Service/CredentialService.php index 49b403ec..325b4fa6 100644 --- a/lib/Service/CredentialService.php +++ b/lib/Service/CredentialService.php @@ -37,12 +37,14 @@ class CredentialService { private CredentialMapper $credentialMapper; private SharingACLMapper $sharingACL; + private ShareService $shareService; private EncryptService $encryptService; private $server_key; - public function __construct(CredentialMapper $credentialMapper, SharingACLMapper $sharingACL, EncryptService $encryptService, IConfig $config) { + public function __construct(CredentialMapper $credentialMapper, SharingACLMapper $sharingACL, ShareService $shareService, EncryptService $encryptService, IConfig $config) { $this->credentialMapper = $credentialMapper; $this->sharingACL = $sharingACL; + $this->shareService = $shareService; $this->encryptService = $encryptService; $this->server_key = $config->getSystemValue('passwordsalt', ''); } @@ -93,6 +95,7 @@ class CredentialService { * @return Entity */ public function deleteCredential(Credential $credential) { + $this->shareService->unshareCredential($credential->getGuid()); return $this->credentialMapper->deleteCredential($credential); } |