diff options
author | Vincent Petry <vincent@nextcloud.com> | 2021-03-26 16:54:47 +0100 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2021-03-26 16:54:47 +0100 |
commit | 00d83a5db056a9c466831fd45347f414bd81f3ae (patch) | |
tree | 10cf247ee38e67bab1720e7ad58486269defd8f3 /apps/provisioning_api/lib | |
parent | 5a8b7c1cb21a72c4d43f1e842f52a237d0abfd12 (diff) | |
download | nextcloud-server-00d83a5db056a9c466831fd45347f414bd81f3ae.tar.gz nextcloud-server-00d83a5db056a9c466831fd45347f414bd81f3ae.zip |
Capability for federated scope
Added additional capability in the provisioning API to signal whether
the federation scope values can be used.
This is based on whether the lookup server upload is enabled or not.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'apps/provisioning_api/lib')
-rw-r--r-- | apps/provisioning_api/lib/Capabilities.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/provisioning_api/lib/Capabilities.php b/apps/provisioning_api/lib/Capabilities.php index 398502ae31c..d355e4db4c2 100644 --- a/apps/provisioning_api/lib/Capabilities.php +++ b/apps/provisioning_api/lib/Capabilities.php @@ -23,6 +23,7 @@ namespace OCA\Provisioning_API; +use OCA\FederatedFileSharing\FederatedShareProvider; use OCP\App\IAppManager; use OCP\Capabilities\ICapability; @@ -41,10 +42,20 @@ class Capabilities implements ICapability { * @return array Array containing the apps capabilities */ public function getCapabilities() { + $federationScopesEnabled = false; + + $federatedFileSharingEnabled = $this->appManager->isEnabledForUser('federatedfilesharing'); + if ($federatedFileSharingEnabled) { + /** @var FederatedShareProvider $shareProvider */ + $shareProvider = \OC::$server->query(FederatedShareProvider::class); + $federationScopesEnabled = $shareProvider->isLookupServerUploadEnabled(); + } + return [ 'provisioning_api' => [ 'version' => $this->appManager->getAppVersion('provisioning_api'), 'AccountPropertyScopesVersion' => 2, + 'AccountPropertyScopesFederationEnabled' => $federationScopesEnabled, ] ]; } |