summaryrefslogtreecommitdiffstats
path: root/lib/private/share20
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/share20')
-rw-r--r--lib/private/share20/manager.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/share20/manager.php b/lib/private/share20/manager.php
index 9b33e947557..9fe33757473 100644
--- a/lib/private/share20/manager.php
+++ b/lib/private/share20/manager.php
@@ -197,6 +197,11 @@ class Manager implements IManager {
throw new \InvalidArgumentException('Path should be either a file or a folder');
}
+ // And you can't share your rootfolder
+ if ($this->rootFolder->getUserFolder($share->getSharedBy())->isSubNode($share->getNode()) === false) {
+ throw new \InvalidArgumentException('You can\'t share your root folder');
+ }
+
// Check if we actually have share permissions
if (!$share->getNode()->isShareable()) {
$message_t = $this->l->t('You are not allowed to share %s', [$share->getNode()->getPath()]);