]> source.dussan.org Git - nextcloud-server.git/commitdiff
remove share permissions if user is excluded from sharing
authorBjoern Schiessle <schiessle@owncloud.com>
Fri, 8 Aug 2014 10:16:54 +0000 (12:16 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Fri, 8 Aug 2014 12:01:49 +0000 (14:01 +0200)
lib/private/files/view.php

index e08cb20f73dd8e1ada3114a2c0121485d8a820c1..11c25f89c04c88ccb1efbb7c9adcf8958d23d27a 100644 (file)
@@ -957,6 +957,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);
                        }
 
@@ -1005,6 +1009,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);
                                                }
                                        }