summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-09-09 13:48:48 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-09-16 17:29:02 +0000
commitf140e3a03a505a62ba861b239fb781f8e8b10a65 (patch)
treee82180422e6de4f0bb3d8a6ac8cc6638810aa7ec /apps/files_sharing/lib
parentc1a7a026f69a965e08dfd247c625b71de41942df (diff)
downloadnextcloud-server-f140e3a03a505a62ba861b239fb781f8e8b10a65.tar.gz
nextcloud-server-f140e3a03a505a62ba861b239fb781f8e8b10a65.zip
only get the permissions from the share source if it's not already cached
this prevents having to setup the share source when doing metadata stuff on the share root Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Cache.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index 587d49f4a46..dae33376f6d 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -146,17 +146,16 @@ class Cache extends CacheJail {
}
try {
- $sharePermissions = $this->storage->getPermissions($entry['path']);
+ if (isset($entry['permissions'])) {
+ $entry['permissions'] &= $this->storage->getShare()->getPermissions();
+ } else {
+ $entry['permissions'] = $this->storage->getPermissions($entry['path']);
+ }
} catch (StorageNotAvailableException $e) {
// thrown by FailedStorage e.g. when the sharer does not exist anymore
// (IDE may say the exception is never thrown – false negative)
$sharePermissions = 0;
}
- if (isset($entry['permissions'])) {
- $entry['permissions'] &= $sharePermissions;
- } else {
- $entry['permissions'] = $sharePermissions;
- }
$entry['uid_owner'] = $this->storage->getOwner('');
$entry['displayname_owner'] = $this->getOwnerDisplayName();
if ($path === '') {