aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-06-03 19:13:51 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-06-03 19:13:51 +0200
commit6764d5b122fbdf105dc34c2fa3ccb7cf3eae3c6e (patch)
tree12c234a0b92ba59548a369b34bef622a7751950b /lib
parent21d1e5eccc262824b39645ca05c848897f14f2ac (diff)
parent916f85937785f6580f201cdf95fb42f63457af94 (diff)
downloadnextcloud-server-6764d5b122fbdf105dc34c2fa3ccb7cf3eae3c6e.tar.gz
nextcloud-server-6764d5b122fbdf105dc34c2fa3ccb7cf3eae3c6e.zip
Merge pull request #8698 from owncloud/sharing_improve_permissions
get permissions directly from share storage to avoid additional db calls
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/cache/permissions.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/private/files/cache/permissions.php b/lib/private/files/cache/permissions.php
index eba18af3863..a2a614ca0b1 100644
--- a/lib/private/files/cache/permissions.php
+++ b/lib/private/files/cache/permissions.php
@@ -15,14 +15,28 @@ class Permissions {
private $storageId;
/**
+ * @var \OC\Files\Storage\Storage $storage
+ */
+ protected $storage;
+
+ /**
* @param \OC\Files\Storage\Storage|string $storage
*/
public function __construct($storage) {
if ($storage instanceof \OC\Files\Storage\Storage) {
$this->storageId = $storage->getId();
+ $this->storage = $storage;
} else {
$this->storageId = $storage;
+ $mountManager = \OC\Files\Filesystem::getMountManager();
+ $mount = $mountManager->findByStorageId($this->storageId);
+ $firstMountPoint = reset($mount);
+ if ($firstMountPoint instanceof \OC\Files\Storage\Storage) {
+ $storage = $firstMountPoint->getStorage();
+ $this->storage = $storage;
+ }
}
+
}
/**