From fc72d4b10f0b0a78faee2f133e833fa6ea10ced7 Mon Sep 17 00:00:00 2001
From: Michael Gapczynski <mtgap@owncloud.com>
Date: Tue, 24 Jul 2012 21:16:47 -0400
Subject: Add root directory checks for CRUDS permissions in shared storage

---
 apps/files_sharing/sharedstorage.php | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'apps/files_sharing')

diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php
index a4510f2e77c..38d5f10e286 100644
--- a/apps/files_sharing/sharedstorage.php
+++ b/apps/files_sharing/sharedstorage.php
@@ -188,6 +188,9 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
 	}
 
 	public function isCreatable($path) {
+		if ($path == '') {
+			return false;
+		}
 		return ($this->getPermissions($path) & OCP\Share::PERMISSION_CREATE);
 	}
 
@@ -196,14 +199,23 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
 	}
 
 	public function isUpdatable($path) {
+		if ($path == '') {
+			return false;
+		}
 		return ($this->getPermissions($path) & OCP\Share::PERMISSION_UPDATE);
 	}
 
 	public function isDeletable($path) {
+		if ($path == '') {
+			return false;
+		}
 		return ($this->getPermissions($path) & OCP\Share::PERMISSION_DELETE);
 	}
 
 	public function isSharable($path) {
+		if ($path == '') {
+			return false;
+		}
 		return ($this->getPermissions($path) & OCP\Share::PERMISSION_SHARE);
 	}
 
-- 
cgit v1.2.3