Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/passman.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbinsky <timo@binsky.org>2021-03-22 22:10:00 +0300
committerbinsky <timo@binsky.org>2021-03-22 22:10:00 +0300
commit80d76f469727b3c11b8f722c79fbf394231923c3 (patch)
treea6c33056571653c9da67b70c6ea97fa882f8fc8e
parent74a23d08c279c59a16e503ea8392a9f25ff1ca78 (diff)
verify that deleting a credential will delete all related shares; fix #664
-rw-r--r--lib/Service/CredentialService.php5
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);
}