]> source.dussan.org Git - nextcloud-server.git/commitdiff
don't display share permission if resharing was disabled by the admin
authorBjoern Schiessle <schiessle@owncloud.com>
Tue, 5 Aug 2014 08:57:13 +0000 (10:57 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Tue, 5 Aug 2014 08:57:51 +0000 (10:57 +0200)
core/js/config.php
core/js/share.js
lib/private/share/share.php
lib/public/share.php

index 0ab74d2949e7b626b61c1794678106332ac9251b..b61694522db2b7fbe8aa757b67132438a30128b7 100644 (file)
@@ -83,6 +83,7 @@ $array = array(
                                'defaultExpireDateEnforced' => $enforceDefaultExpireDate,
                                'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(),
                                'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(),
+                               'resharingAllowed' => \OCP\Share::isResharingAllowed(),
                                )
                        )
        ),
index 14abdf18ade180c2896726127d525d61504614d1..1b4e519f2012f06eb2462f04cf9113cabca2750f 100644 (file)
@@ -488,7 +488,7 @@ OC.Share={
                                if (possiblePermissions & OC.PERMISSION_DELETE) {
                                        permissions = permissions | OC.PERMISSION_DELETE;
                                }
-                               if (possiblePermissions & OC.PERMISSION_SHARE) {
+                               if (oc_appconfig.core.resharingAllowed && (possiblePermissions & OC.PERMISSION_SHARE)) {
                                        permissions = permissions | OC.PERMISSION_SHARE;
                                }
 
@@ -620,7 +620,7 @@ OC.Share={
                                }
                                html += '<label><input type="checkbox" name="mailNotification" class="mailNotification" ' + checked + ' />'+t('core', 'notify by email')+'</label> ';
                        }
-                       if (possiblePermissions & OC.PERMISSION_SHARE) {
+                       if (oc_appconfig.core.resharingAllowed && (possiblePermissions & OC.PERMISSION_SHARE)) {
                                html += '<label><input type="checkbox" name="share" class="permissions" '+shareChecked+' data-permissions="'+OC.PERMISSION_SHARE+'" />'+t('core', 'can share')+'</label>';
                        }
                        if (possiblePermissions & OC.PERMISSION_CREATE || possiblePermissions & OC.PERMISSION_UPDATE || possiblePermissions & OC.PERMISSION_DELETE) {
index 450c71cf8a2c2cd940a30bec6d595611d9d2801c..b8e7ffa4536287f10e32368c6b77cf85fc1b38b0 100644 (file)
@@ -1114,7 +1114,7 @@ class Share extends \OC\Share\Constants {
         *
         * Resharing is allowed by default if not configured
         */
-       private static function isResharingAllowed() {
+       public static function isResharingAllowed() {
                if (!isset(self::$isResharingAllowed)) {
                        if (\OC_Appconfig::getValue('core', 'shareapi_allow_resharing', 'yes') == 'yes') {
                                self::$isResharingAllowed = true;
index c0939dce53f367a96ea0b98f440b5e36006e5b71..e6519dd3e3a8a36f347cf0154e9dcd7496fe93ef 100644 (file)
@@ -330,6 +330,15 @@ class Share extends \OC\Share\Constants {
        public static function checkPasswordProtectedShare(array $linkItem) {
                return \OC\Share\Share::checkPasswordProtectedShare($linkItem);
        }
+
+       /**
+        * Check if resharing is allowed
+        *
+        * @return boolean true if allowed or false
+        */
+       public static function isResharingAllowed() {
+               return \OC\Share\Share::isResharingAllowed();
+       }
 }
 
 /**