don't display share permission if resharing was disabled by the admin

remotes/origin/fix-10825
Bjoern Schiessle 12 years ago
parent c0e78d9841
commit 41cca70a63
  1. 1
      core/js/config.php
  2. 4
      core/js/share.js
  3. 2
      lib/private/share/share.php
  4. 9
      lib/public/share.php

@ -83,6 +83,7 @@ $array = array(
'defaultExpireDateEnforced' => $enforceDefaultExpireDate,
'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(),
'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(),
'resharingAllowed' => \OCP\Share::isResharingAllowed(),
)
)
),

@ -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) {

@ -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;

@ -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();
}
}
/**

Loading…
Cancel
Save