Merge branch 'sharing_no_groups' of github.com:nextcloud/passman into sharing_no_groups

This commit is contained in:
brantje 2016-10-03 17:57:20 +02:00
commit 5f337e323a
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F

View file

@ -11,6 +11,7 @@ namespace OCA\Passman\Service;
use Icewind\SMB\Share; use Icewind\SMB\Share;
use OCA\Passman\Db\CredentialMapper; use OCA\Passman\Db\CredentialMapper;
use OCA\Passman\Db\CredentialRevision;
use OCA\Passman\Db\ShareRequest; 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;
@ -118,6 +119,12 @@ class ShareService {
return $return; return $return;
} }
/**
* Gets history from the given item checking the user's permissions to access it
* @param $user_id
* @param $item_guid
* @return CredentialRevision[]
*/
public function getItemHistory($user_id, $item_guid) { public function getItemHistory($user_id, $item_guid) {
$acl = $this->sharingACL->getItemACL($user_id, $item_guid); $acl = $this->sharingACL->getItemACL($user_id, $item_guid);
if (!$acl->hasPermission(SharingACL::READ | SharingACL::HISTORY)) return []; if (!$acl->hasPermission(SharingACL::READ | SharingACL::HISTORY)) return [];