summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/capabilities.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/capabilities.php')
-rw-r--r--apps/files_sharing/lib/capabilities.php32
1 files changed, 9 insertions, 23 deletions
diff --git a/apps/files_sharing/lib/capabilities.php b/apps/files_sharing/lib/capabilities.php
index ac6454c3433..ef69a40078b 100644
--- a/apps/files_sharing/lib/capabilities.php
+++ b/apps/files_sharing/lib/capabilities.php
@@ -20,6 +20,7 @@
*/
namespace OCA\Files_Sharing;
+use OCP\Capabilities\ICapability;
use \OCP\IConfig;
/**
@@ -27,32 +28,21 @@ use \OCP\IConfig;
*
* @package OCA\Files_Sharing
*/
-class Capabilities {
+class Capabilities implements ICapability {
/** @var IConfig */
private $config;
- /**
- * @param IConfig $config
- */
public function __construct(IConfig $config) {
$this->config = $config;
}
/**
- * @return \OC_OCS_Result
- */
- public static function getCapabilities() {
- $config = \OC::$server->getConfig();
- $cap = new Capabilities($config);
- return $cap->getCaps();
- }
-
-
- /**
- * @return \OC_OCS_Result
+ * Return this classes capabilities
+ *
+ * @return array
*/
- public function getCaps() {
+ public function getCapabilities() {
$res = [];
$public = [];
@@ -76,12 +66,8 @@ class Capabilities {
$res['resharing'] = $this->config->getAppValue('core', 'shareapi_allow_resharing', 'yes') === 'yes';
-
- return new \OC_OCS_Result([
- 'capabilities' => [
- 'files_sharing' => $res
- ],
- ]);
+ return [
+ 'files_sharing' => $res,
+ ];
}
-
}