summaryrefslogtreecommitdiffstats
path: root/apps/sharebymail/lib/Capabilities.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/sharebymail/lib/Capabilities.php')
-rw-r--r--apps/sharebymail/lib/Capabilities.php31
1 files changed, 21 insertions, 10 deletions
diff --git a/apps/sharebymail/lib/Capabilities.php b/apps/sharebymail/lib/Capabilities.php
index e703b9b1e5f..bc2d2baf817 100644
--- a/apps/sharebymail/lib/Capabilities.php
+++ b/apps/sharebymail/lib/Capabilities.php
@@ -1,4 +1,6 @@
<?php
+
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2017 Bjoern Schiessle <bjoern@schiessle.org>
*
@@ -23,26 +25,35 @@
namespace OCA\ShareByMail;
+use OCA\ShareByMail\Settings\SettingsManager;
use OCP\Capabilities\ICapability;
class Capabilities implements ICapability {
- /**
- * Function an app uses to return the capabilities
- *
- * @return array Array containing the apps capabilities
- * @since 8.2.0
- */
- public function getCapabilities() {
+ /** @var SettingsManager */
+ private $manager;
+
+ public function __construct(SettingsManager $manager) {
+ $this->manager = $manager;
+ }
+
+ public function getCapabilities(): array {
return [
'files_sharing' =>
[
'sharebymail' =>
[
'enabled' => true,
- 'upload_files_drop' => ['enabled' => true],
- 'password' => ['enabled' => true],
- 'expire_date' => ['enabled' => true]
+ 'upload_files_drop' => [
+ 'enabled' => true,
+ ],
+ 'password' => [
+ 'enabled' => true,
+ 'enforced' => $this->manager->enforcePasswordProtection(),
+ ],
+ 'expire_date' => [
+ 'enabled' => true,
+ ],
]
]
];