12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace OCA\Provisioning_API;
- use OCA\FederatedFileSharing\FederatedShareProvider;
- use OCP\App\IAppManager;
- use OCP\Capabilities\ICapability;
- class Capabilities implements ICapability {
- public function __construct(
- private IAppManager $appManager,
- ) {
- }
-
- public function getCapabilities() {
- $federatedScopeEnabled = $this->appManager->isEnabledForUser('federation');
- $publishedScopeEnabled = false;
- $federatedFileSharingEnabled = $this->appManager->isEnabledForUser('federatedfilesharing');
- if ($federatedFileSharingEnabled) {
-
- $shareProvider = \OC::$server->query(FederatedShareProvider::class);
- $publishedScopeEnabled = $shareProvider->isLookupServerUploadEnabled();
- }
- return [
- 'provisioning_api' => [
- 'version' => $this->appManager->getAppVersion('provisioning_api'),
- 'AccountPropertyScopesVersion' => 2,
- 'AccountPropertyScopesFederatedEnabled' => $federatedScopeEnabled,
- 'AccountPropertyScopesPublishedEnabled' => $publishedScopeEnabled,
- ]
- ];
- }
- }
|