[Pkg-owncloud-commits] [owncloud] 08/121: don't display share permission if resharing was disabled by the admin
David Prévot
taffit at moszumanska.debian.org
Thu Aug 21 16:44:25 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit a1656abb4cab9f69fc770a38fb4d68b002468391
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date: Tue Aug 5 10:57:13 2014 +0200
don't display share permission if resharing was disabled by the admin
---
core/js/config.php | 1 +
core/js/share.js | 4 ++--
lib/private/share/share.php | 2 +-
lib/public/share.php | 9 +++++++++
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/core/js/config.php b/core/js/config.php
index 2f42311..7e0a275 100644
--- a/core/js/config.php
+++ b/core/js/config.php
@@ -83,6 +83,7 @@ $array = array(
'defaultExpireDateEnforced' => $enforceDefaultExpireDate,
'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(),
'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(),
+ 'resharingAllowed' => \OCP\Share::isResharingAllowed(),
)
)
),
diff --git a/core/js/share.js b/core/js/share.js
index 14abdf1..1b4e519 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -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) {
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 7fd5cd7..7a1e129 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -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;
diff --git a/lib/public/share.php b/lib/public/share.php
index c0939dc..e6519dd 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -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();
+ }
}
/**
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list