summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-03-31 09:27:38 +0200
committerRoeland Jago Douma <rullzer@owncloud.com>2016-04-04 19:35:01 +0200
commitdb5ea95e2932fe1ade08da2dfe40d2b5473842cd (patch)
treecef6675f116173a09b285d009ec6cabd4cadc3a0 /apps
parent6ecd1d9e86dc3f2b70da1071a13f661702627624 (diff)
downloadnextcloud-server-db5ea95e2932fe1ade08da2dfe40d2b5473842cd.tar.gz
nextcloud-server-db5ea95e2932fe1ade08da2dfe40d2b5473842cd.zip
Add capability to show if group sharing is enabled
fixes #23477 Now clients can correct wording to properly reflect who a user can share with.
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/capabilities.php2
-rw-r--r--apps/files_sharing/tests/capabilities.php18
2 files changed, 20 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/capabilities.php b/apps/files_sharing/lib/capabilities.php
index 913f248b174..5ec540ad4e0 100644
--- a/apps/files_sharing/lib/capabilities.php
+++ b/apps/files_sharing/lib/capabilities.php
@@ -74,6 +74,8 @@ class Capabilities implements ICapability {
$res['user']['send_mail'] = $this->config->getAppValue('core', 'shareapi_allow_mail_notification', 'no') === 'yes';
$res['resharing'] = $this->config->getAppValue('core', 'shareapi_allow_resharing', 'yes') === 'yes';
+
+ $res['group_sharing'] = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes';
}
//Federated sharing
diff --git a/apps/files_sharing/tests/capabilities.php b/apps/files_sharing/tests/capabilities.php
index 7572f5c84aa..0e17811be03 100644
--- a/apps/files_sharing/tests/capabilities.php
+++ b/apps/files_sharing/tests/capabilities.php
@@ -243,6 +243,24 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase {
$this->assertFalse($result['public']['upload']);
}
+ public function testNoGroupSharing() {
+ $map = [
+ ['core', 'shareapi_enabled', 'yes', 'yes'],
+ ['core', 'shareapi_allow_group_sharing', 'yes', 'no'],
+ ];
+ $result = $this->getResults($map);
+ $this->assertFalse($result['group_sharing']);
+ }
+
+ public function testGroupSharing() {
+ $map = [
+ ['core', 'shareapi_enabled', 'yes', 'yes'],
+ ['core', 'shareapi_allow_group_sharing', 'yes', 'yes'],
+ ];
+ $result = $this->getResults($map);
+ $this->assertTrue($result['group_sharing']);
+ }
+
public function testFederatedSharingIncomming() {
$map = [
['files_sharing', 'incoming_server2server_share_enabled', 'yes', 'yes'],