mirror of
https://github.com/nextcloud/passman.git
synced 2025-10-28 06:15:55 +08:00
Merge branch 'sharing_no_groups' of github.com:nextcloud/passman into sharing_no_groups
This commit is contained in:
commit
8b1b90ac5d
1 changed files with 3 additions and 2 deletions
|
|
@ -16,6 +16,7 @@ use OCA\Passman\Db\ShareRequest;
|
||||||
use OCA\Passman\Db\ShareRequestMapper;
|
use OCA\Passman\Db\ShareRequestMapper;
|
||||||
use OCA\Passman\Db\SharingACL;
|
use OCA\Passman\Db\SharingACL;
|
||||||
use OCA\Passman\Db\SharingACLMapper;
|
use OCA\Passman\Db\SharingACLMapper;
|
||||||
|
use OCP\AppFramework\Db\DoesNotExistException;
|
||||||
|
|
||||||
class ShareService {
|
class ShareService {
|
||||||
private $sharingACL;
|
private $sharingACL;
|
||||||
|
|
@ -128,9 +129,9 @@ class ShareService {
|
||||||
$acl = $this->sharingACL->getItemACL($user_id, $item_guid);
|
$acl = $this->sharingACL->getItemACL($user_id, $item_guid);
|
||||||
|
|
||||||
// Check if the user can read the credential, probably unnecesary, but just to be sure
|
// 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");
|
||||||
|
|
||||||
$return = $acl->jsonSerialize();
|
$tmp = $acl->jsonSerialize();
|
||||||
$tmp['credential_data'] = $this->credential->getCredentialById($acl->getItemId())->jsonSerialize();
|
$tmp['credential_data'] = $this->credential->getCredentialById($acl->getItemId())->jsonSerialize();
|
||||||
|
|
||||||
if (!$acl->hasPermission(SharingACL::FILES)) unset($tmp['credential_data']['files']);
|
if (!$acl->hasPermission(SharingACL::FILES)) unset($tmp['credential_data']['files']);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue