From 2454759af785e89b1852e381ad9249db98dd304b Mon Sep 17 00:00:00 2001
From: Lukas Reschke <lukas@statuscode.ch>
Date: Sun, 13 Apr 2014 11:01:50 +0200
Subject: [PATCH] Check whether the user has permissions to add personal
 storage backends

---
 apps/files_external/lib/config.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 613f0b2609..71f6ae7887 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -206,6 +206,12 @@ class OC_Mount_Config {
 	*/
 	public static function getPersonalBackends() {
 
+		// Check whether the user has permissions to add personal storage backends
+		// return an empty array if this is not the case
+		if(OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes') !== 'yes') {
+			return array();
+		}
+
 		$backEnds = self::getBackends();
 
 		// Remove local storage and other disabled storages
-- 
GitLab