summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/MountProvider.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-08-21 16:15:23 +0200
committerJoas Schilling <coding@schilljs.com>2019-11-12 17:13:38 +0100
commitdcdbea54e60d13d2508b71ebdcb7992f2ae5ef34 (patch)
tree4157d8fbbec25f53ab99df3c7e495f8d8862fc36 /apps/files_sharing/lib/MountProvider.php
parent6f8c7885b6263b7e23f0e48c1376b7e67417be2c (diff)
downloadnextcloud-server-dcdbea54e60d13d2508b71ebdcb7992f2ae5ef34.tar.gz
nextcloud-server-dcdbea54e60d13d2508b71ebdcb7992f2ae5ef34.zip
Respect the accepted flag for group and user shares
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files_sharing/lib/MountProvider.php')
-rw-r--r--apps/files_sharing/lib/MountProvider.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php
index 47a787350d5..1f733969966 100644
--- a/apps/files_sharing/lib/MountProvider.php
+++ b/apps/files_sharing/lib/MountProvider.php
@@ -35,6 +35,7 @@ use OCP\IConfig;
use OCP\ILogger;
use OCP\IUser;
use OCP\Share\IManager;
+use OCP\Share\IShare;
class MountProvider implements IMountProvider {
/**
@@ -94,6 +95,11 @@ class MountProvider implements IMountProvider {
try {
/** @var \OCP\Share\IShare $parentShare */
$parentShare = $share[0];
+
+ if ($parentShare->getStatus() !== IShare::STATUS_ACCEPTED) {
+ continue;
+ }
+
$owner = $parentShare->getShareOwner();
if (!isset($ownerViews[$owner])) {
$ownerViews[$owner] = new View('/' . $parentShare->getShareOwner() . '/files');
@@ -188,8 +194,11 @@ class MountProvider implements IMountProvider {
// use most permissive permissions
$permissions = 0;
+ $status = IShare::STATUS_PENDING;
foreach ($shares as $share) {
$permissions |= $share->getPermissions();
+ $status = max($status, $share->getStatus());
+
if ($share->getTarget() !== $superShare->getTarget()) {
// adjust target, for database consistency
$share->setTarget($superShare->getTarget());
@@ -216,7 +225,8 @@ class MountProvider implements IMountProvider {
}
}
- $superShare->setPermissions($permissions);
+ $superShare->setPermissions($permissions)
+ ->setStatus($status);
$result[] = [$superShare, $shares];
}