diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 8899df25636b716e532505a7cb5a2a594663aa07..e62bdebc08e2d4b407f76580b0a494b5b42b6bc0 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -635,7 +635,7 @@ class Share extends Constants {
 				throw new \Exception($message_t);
 			}
 			// verify that the user has share permission
-			if (!\OC\Files\Filesystem::isSharable($path)) {
+			if (!\OC\Files\Filesystem::isSharable($path) || \OCP\Util::isSharingDisabledForUser()) {
 				$message = 'You are not allowed to share %s';
 				$message_t = $l->t('You are not allowed to share %s', [$path]);
 				\OCP\Util::writeLog('OCP\Share', sprintf($message, $path), \OCP\Util::DEBUG);