diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-08-08 12:16:54 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-08-08 12:16:54 +0200 |
commit | 6dda30b5a2adc48a79aff05221020d07f773dffb (patch) | |
tree | 7bb1b8d9295c579a9f423730da569666002685e0 | |
parent | 008498dcadf6dbdce43efe042a1670a22cb3f833 (diff) | |
download | nextcloud-server-6dda30b5a2adc48a79aff05221020d07f773dffb.tar.gz nextcloud-server-6dda30b5a2adc48a79aff05221020d07f773dffb.zip |
remove share permissions if user is excluded from sharing
-rw-r--r-- | lib/private/files/view.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 85af4a9abef..2a28e6fce88 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -960,6 +960,10 @@ class View { $content['permissions'] = $storage->getPermissions($content['path']); $cache->update($content['fileid'], array('permissions' => $content['permissions'])); } + // if sharing was disabled for the user we remove the share permissions + if (\OCP\Util::isSharingDisabledForUser()) { + $content['permissions'] = $content['permissions'] & ~\OCP\PERMISSION_SHARE; + } $files[] = new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content); } @@ -1008,6 +1012,12 @@ class View { } } $rootEntry['path'] = substr($path . '/' . $rootEntry['name'], strlen($user) + 2); // full path without /$user/ + + // if sharing was disabled for the user we remove the share permissions + if (\OCP\Util::isSharingDisabledForUser()) { + $content['permissions'] = $content['permissions'] & ~\OCP\PERMISSION_SHARE; + } + $files[] = new FileInfo($path . '/' . $rootEntry['name'], $subStorage, '', $rootEntry); } } |