summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-03-30 16:29:34 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2017-04-07 15:43:59 +0200
commit676a4c781a5ff16ea34259c2958521596efc89b1 (patch)
tree8a7d79bbfde175b546d93a37063834b4a55a8702 /apps/files_sharing/lib
parent5540def5e332b30d42c0c3484d3c732278f8f6b8 (diff)
downloadnextcloud-server-676a4c781a5ff16ea34259c2958521596efc89b1.tar.gz
nextcloud-server-676a4c781a5ff16ea34259c2958521596efc89b1.zip
update capabilities
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Capabilities.php26
1 files changed, 24 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/Capabilities.php b/apps/files_sharing/lib/Capabilities.php
index bfbd15c1122..ed00cdc00a6 100644
--- a/apps/files_sharing/lib/Capabilities.php
+++ b/apps/files_sharing/lib/Capabilities.php
@@ -21,6 +21,7 @@
*/
namespace OCA\Files_Sharing;
+use OCP\App\IAppManager;
use OCP\Capabilities\ICapability;
use \OCP\IConfig;
@@ -34,8 +35,12 @@ class Capabilities implements ICapability {
/** @var IConfig */
private $config;
- public function __construct(IConfig $config) {
+ /** @var IAppManager */
+ private $appManager;
+
+ public function __construct(IConfig $config, IAppManager $appManager) {
$this->config = $config;
+ $this->appManager = $appManager;
}
/**
@@ -76,16 +81,33 @@ class Capabilities implements ICapability {
$res['resharing'] = $this->config->getAppValue('core', 'shareapi_allow_resharing', 'yes') === 'yes';
$res['user']['send_mail'] = false;
+ $res['user']['expire_date']['enabled'] = true;
+ // deprecated in favour of 'group', but we need to keep it for now
+ // in order to stay compatible with older clients
$res['group_sharing'] = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes';
+
+ $res['group'] = [];
+ $res['group']['enabled'] = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes';
+ $res['group']['expire_date']['enabled'] = true;
}
//Federated sharing
$res['federation'] = [
'outgoing' => $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes',
- 'incoming' => $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'yes'
+ 'incoming' => $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'yes',
+ 'expire_date' => ['enabled' => true]
];
+ if ($this->appManager->isEnabledForUser('sharebymail')) {
+ $res['mailshare'] = [
+ 'enabled' => true,
+ 'upload_files_drop' => ['enabled' => true],
+ 'password' => ['enabled' => true],
+ 'expire_date' => ['enabled' => true]
+ ];
+ }
+
return [
'files_sharing' => $res,
];