mirror of
https://github.com/nextcloud/passman.git
synced 2025-09-27 15:24:36 +08:00
Behave as if no item was found if public user has no read permission
This commit is contained in:
parent
1ba859269f
commit
62b54aee8e
1 changed files with 2 additions and 1 deletions
|
@ -16,6 +16,7 @@ use OCA\Passman\Db\ShareRequest;
|
|||
use OCA\Passman\Db\ShareRequestMapper;
|
||||
use OCA\Passman\Db\SharingACL;
|
||||
use OCA\Passman\Db\SharingACLMapper;
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
|
||||
class ShareService {
|
||||
private $sharingACL;
|
||||
|
@ -128,7 +129,7 @@ class ShareService {
|
|||
$acl = $this->sharingACL->getItemACL($user_id, $item_guid);
|
||||
|
||||
// Check if the user can read the credential, probably unnecesary, but just to be sure
|
||||
if (!$acl->hasPermission(SharingACL::READ)) return null;
|
||||
if (!$acl->hasPermission(SharingACL::READ)) throw new DoesNotExistException("Item not found or wrong access level");
|
||||
|
||||
$tmp = $acl->jsonSerialize();
|
||||
$tmp['credential_data'] = $this->credential->getCredentialById($acl->getItemId())->jsonSerialize();
|
||||
|
|
Loading…
Add table
Reference in a new issue