mirror of
https://github.com/nextcloud/passman.git
synced 2026-01-04 06:37:12 +08:00
Fix owner's shared key being gone when bob updates credential
This commit is contained in:
parent
653fd9bace
commit
bec9252bc9
1 changed files with 5 additions and 2 deletions
|
|
@ -127,14 +127,17 @@ class CredentialController extends ApiController {
|
|||
'delete_time' => $delete_time,
|
||||
'hidden' => $hidden,
|
||||
'otp' => $otp,
|
||||
'shared_key' => ($shared_key === null) ? null : $storedCredential->getSharedKey(),
|
||||
'shared_key' => $shared_key,
|
||||
);
|
||||
|
||||
|
||||
|
||||
if ($storedCredential->getUserId() !== $this->userId){
|
||||
$acl = $this->sharingService->getCredentialAclForUser($this->userId, $storedCredential->getGuid());
|
||||
if (!$acl->hasPermission(SharingACL::WRITE)){
|
||||
if ($acl->hasPermission(SharingACL::WRITE)) {
|
||||
$credential['shared_key'] = $storedCredential->getSharedKey();
|
||||
}
|
||||
else {
|
||||
return new DataResponse(['msg' => 'Not authorized'], Http::STATUS_UNAUTHORIZED);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue