Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-22 19:16:23 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-22 19:16:23 +0300
commit1a100c69ba2456e99d19c9c4c5503b7b0d6dac68 (patch)
tree9bbbd0bde6ef0bc7a7085dd114c6feea88775072 /lib
parent03fcbc8cebffcce8d6bc53c5a73051f512647557 (diff)
parentf8f292ab16f70eaf4a248883150369b0eb2de7aa (diff)
Merge pull request #23473 from owncloud/stable9_23398
[stable 9] Allow blocking of group sharing
Diffstat (limited to 'lib')
-rw-r--r--lib/private/share20/manager.php12
-rw-r--r--lib/public/share/imanager.php7
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/private/share20/manager.php b/lib/private/share20/manager.php
index 6f370eea424..5e40acefbef 100644
--- a/lib/private/share20/manager.php
+++ b/lib/private/share20/manager.php
@@ -361,6 +361,11 @@ class Manager implements IManager {
* @throws \Exception
*/
protected function groupCreateChecks(\OCP\Share\IShare $share) {
+ // Verify group shares are allowed
+ if (!$this->allowGroupSharing()) {
+ throw new \Exception('Group sharing is now allowed');
+ }
+
// Verify if the user can share with this group
if ($this->shareWithGroupMembersOnly()) {
$sharedBy = $this->userManager->get($share->getSharedBy());
@@ -1111,6 +1116,13 @@ class Manager implements IManager {
return $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes';
}
+ /**
+ * Check if users can share with groups
+ * @return bool
+ */
+ public function allowGroupSharing() {
+ return $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes';
+ }
/**
* Copied from \OC_Util::isSharingDisabledForUser
diff --git a/lib/public/share/imanager.php b/lib/public/share/imanager.php
index f926104dde0..7f1424c8ea8 100644
--- a/lib/public/share/imanager.php
+++ b/lib/public/share/imanager.php
@@ -221,6 +221,13 @@ interface IManager {
public function shareWithGroupMembersOnly();
/**
+ * Check if users can share with groups
+ * @return bool
+ * @since 9.0.1
+ */
+ public function allowGroupSharing();
+
+ /**
* Check if sharing is disabled for the given user
*
* @param string $userId