diff --git a/apps/files/tests/controller/apicontrollertest.php b/apps/files/tests/controller/apicontrollertest.php
index fb728d5eff054a8ee87c67bbc7c538ab5fdb1c24..bc66e4641b9eed3711196aa07874da7783871ea7 100644
--- a/apps/files/tests/controller/apicontrollertest.php
+++ b/apps/files/tests/controller/apicontrollertest.php
@@ -92,6 +92,7 @@ class ApiControllerTest extends TestCase {
 			[
 				'mtime' => 55,
 				'mimetype' => 'application/pdf',
+				'permissions' => 31,
 				'size' => 1234,
 				'etag' => 'MyEtag',
 			],
@@ -111,7 +112,7 @@ class ApiControllerTest extends TestCase {
 					'parentId' => null,
 					'mtime' => 55000,
 					'name' => 'root.txt',
-					'permissions' => null,
+					'permissions' => 31,
 					'mimetype' => 'application/pdf',
 					'size' => 1234,
 					'type' => 'file',
@@ -139,6 +140,7 @@ class ApiControllerTest extends TestCase {
 			[
 				'mtime' => 55,
 				'mimetype' => 'application/pdf',
+				'permissions' => 31,
 				'size' => 1234,
 				'etag' => 'MyEtag',
 			],
@@ -155,6 +157,7 @@ class ApiControllerTest extends TestCase {
 			[
 				'mtime' => 999,
 				'mimetype' => 'application/binary',
+				'permissions' => 31,
 				'size' => 9876,
 				'etag' => 'SubEtag',
 			],
@@ -174,7 +177,7 @@ class ApiControllerTest extends TestCase {
 					'parentId' => null,
 					'mtime' => 55000,
 					'name' => 'root.txt',
-					'permissions' => null,
+					'permissions' => 31,
 					'mimetype' => 'application/pdf',
 					'size' => 1234,
 					'type' => 'file',
@@ -191,7 +194,7 @@ class ApiControllerTest extends TestCase {
 					'parentId' => null,
 					'mtime' => 999000,
 					'name' => 'root.txt',
-					'permissions' => null,
+					'permissions' => 31,
 					'mimetype' => 'application/binary',
 					'size' => 9876,
 					'type' => 'file',
diff --git a/lib/private/files/fileinfo.php b/lib/private/files/fileinfo.php
index 5b5e8697004c7eaf1228a7fdb91fab020ea94438..0525c259604ea15517acb329ca42244c96116add 100644
--- a/lib/private/files/fileinfo.php
+++ b/lib/private/files/fileinfo.php
@@ -100,6 +100,8 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
 			return $this->getType();
 		} else if ($offset === 'etag') {
 			return $this->getEtag();
+		} elseif ($offset === 'permissions') {
+			return $this->getPermissions();
 		} elseif (isset($this->data[$offset])) {
 			return $this->data[$offset];
 		} else {
@@ -193,7 +195,11 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
 	 * @return int
 	 */
 	public function getPermissions() {
-		return $this->data['permissions'];
+		$perms = $this->data['permissions'];
+		if (\OCP\Util::isSharingDisabledForUser()) {
+			$perms = $perms & ~\OCP\Constants::PERMISSION_SHARE;
+		}
+		return $perms;
 	}
 
 	/**
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php
index 0cd67e343ff1e7f9d6c920b7754c96e01cb86c99..b06543d0a6a6d4581d90562a614100b530a2e815 100644
--- a/lib/private/files/storage/common.php
+++ b/lib/private/files/storage/common.php
@@ -141,10 +141,6 @@ abstract class Common implements Storage {
 	}
 
 	public function isSharable($path) {
-		if (\OCP\Util::isSharingDisabledForUser()) {
-			return false;
-		}
-
 		return $this->isReadable($path);
 	}