From 008498dcadf6dbdce43efe042a1670a22cb3f833 Mon Sep 17 00:00:00 2001
From: Bjoern Schiessle <schiessle@owncloud.com>
Date: Fri, 8 Aug 2014 12:12:20 +0200
Subject: [PATCH] only show "share with others" and "share by link" navigation
 bar entries if user is allowed to share files

---
 apps/files_sharing/appinfo/app.php | 40 ++++++++++++++++--------------
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php
index b55a80ea64..60bec2b405 100644
--- a/apps/files_sharing/appinfo/app.php
+++ b/apps/files_sharing/appinfo/app.php
@@ -33,21 +33,25 @@ OC_FileProxy::register(new OCA\Files\Share\Proxy());
 		"name" => $l->t('Shared with you')
 	)
 );
-\OCA\Files\App::getNavigationManager()->add(
-	array(
-		"id" => 'sharingout',
-		"appname" => 'files_sharing',
-		"script" => 'list.php',
-		"order" => 15,
-		"name" => $l->t('Shared with others')
-	)
-);
-\OCA\Files\App::getNavigationManager()->add(
-	array(
-		"id" => 'sharinglinks',
-		"appname" => 'files_sharing',
-		"script" => 'list.php',
-		"order" => 20,
-		"name" => $l->t('Shared by link')
-	)
-);
+
+if (\OCP\Util::isSharingDisabledForUser() === false) {
+
+	\OCA\Files\App::getNavigationManager()->add(
+			array(
+				"id" => 'sharingout',
+				"appname" => 'files_sharing',
+				"script" => 'list.php',
+				"order" => 15,
+				"name" => $l->t('Shared with others')
+			)
+	);
+	\OCA\Files\App::getNavigationManager()->add(
+			array(
+				"id" => 'sharinglinks',
+				"appname" => 'files_sharing',
+				"script" => 'list.php',
+				"order" => 20,
+				"name" => $l->t('Shared by link')
+			)
+	);
+}
-- 
GitLab