aboutsummaryrefslogtreecommitdiffstats
path: root/apps/sharebymail/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-09-01 12:02:17 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-09-02 01:16:41 +0200
commite040d939e5fcd0a4835c0d06d3181fb48c8d9294 (patch)
tree28f57ee2c350773e2d44758405bb5752c8d0c2df /apps/sharebymail/lib
parente2303d0cc1166e95b65753f26d46c544df339e86 (diff)
downloadnextcloud-server-e040d939e5fcd0a4835c0d06d3181fb48c8d9294.tar.gz
nextcloud-server-e040d939e5fcd0a4835c0d06d3181fb48c8d9294.zip
feat(files): add sharing icon in header
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/sharebymail/lib')
-rw-r--r--apps/sharebymail/lib/Capabilities.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/sharebymail/lib/Capabilities.php b/apps/sharebymail/lib/Capabilities.php
index 8be0ca380cf..2fe8bef653e 100644
--- a/apps/sharebymail/lib/Capabilities.php
+++ b/apps/sharebymail/lib/Capabilities.php
@@ -28,6 +28,7 @@ declare(strict_types=1);
namespace OCA\ShareByMail;
use OCA\ShareByMail\Settings\SettingsManager;
+use OCP\App\IAppManager;
use OCP\Capabilities\ICapability;
use OCP\Share\IManager;
@@ -39,10 +40,15 @@ class Capabilities implements ICapability {
/** @var SettingsManager */
private $settingsManager;
+ /** @var IAppManager */
+ private $appManager;
+
public function __construct(IManager $manager,
- SettingsManager $settingsManager) {
+ SettingsManager $settingsManager,
+ IAppManager $appManager) {
$this->manager = $manager;
$this->settingsManager = $settingsManager;
+ $this->appManager = $appManager;
}
/**
@@ -64,9 +70,12 @@ class Capabilities implements ICapability {
* },
* }
* }
- * }
+ * }|array<empty>
*/
public function getCapabilities(): array {
+ if (!$this->appManager->isEnabledForUser('files_sharing')) {
+ return [];
+ }
return [
'files_sharing' =>
[