diff options
author | Joas Schilling <coding@schilljs.com> | 2019-02-27 13:52:11 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-03-01 10:53:23 +0300 |
commit | 5605e9ca26ddc4ddca453f8a0abbca52f741aa1b (patch) | |
tree | 3d22401b6c81bd2e80a7775156bb266045299150 /lib/Capabilities.php | |
parent | 5b5dfee9c7d11d9ae5527fdcfd736d0ecb86ba92 (diff) |
Remove capabilities for the mobile clients
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Capabilities.php')
-rw-r--r-- | lib/Capabilities.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Capabilities.php b/lib/Capabilities.php index 16ec9ec50..b41f55d36 100644 --- a/lib/Capabilities.php +++ b/lib/Capabilities.php @@ -25,10 +25,28 @@ declare(strict_types=1); namespace OCA\Spreed; use OCP\Capabilities\IPublicCapability; +use OCP\IUser; +use OCP\IUserSession; class Capabilities implements IPublicCapability { + /** @var Config */ + protected $config; + /** @var IUserSession */ + protected $userSession; + + public function __construct(Config $config, + IUserSession $userSession) { + $this->config = $config; + $this->userSession = $userSession; + } + public function getCapabilities(): array { + $user = $this->userSession->getUser(); + if ($user instanceof IUser && $this->config->isDisabledForUser($user)) { + return []; + } + return [ 'spreed' => [ 'features' => [ |