diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-09-01 12:02:17 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-09-02 01:16:41 +0200 |
commit | e040d939e5fcd0a4835c0d06d3181fb48c8d9294 (patch) | |
tree | 28f57ee2c350773e2d44758405bb5752c8d0c2df /apps/sharebymail/lib | |
parent | e2303d0cc1166e95b65753f26d46c544df339e86 (diff) | |
download | nextcloud-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.php | 13 |
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' => [ |