Only show undelete capability if files_trashbin is enabled

Fixes the OCS capability API at /ocs/v1.php/cloud/capabilities
This commit is contained in:
Lukas Reschke 2014-11-18 23:06:39 +01:00
parent 81d112fb42
commit 61641293f4
3 changed files with 36 additions and 1 deletions

View file

@ -15,7 +15,6 @@ class Capabilities {
'capabilities' => array(
'files' => array(
'bigfilechunking' => true,
'undelete' => true,
),
),
));

View file

@ -13,3 +13,7 @@ $this->create('files_trashbin_ajax_list', 'ajax/list.php')
->actionInclude('files_trashbin/ajax/list.php');
$this->create('files_trashbin_ajax_undelete', 'ajax/undelete.php')
->actionInclude('files_trashbin/ajax/undelete.php');
// Register with the capabilities API
\OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Trashbin\Capabilities', 'getCapabilities'), 'files_trashbin', \OC_API::USER_AUTH);

View file

@ -0,0 +1,32 @@
<?php
/**
* Copyright (c) Lukas Reschke <lukas@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace OCA\Files_Trashbin;
/**
* Class Capabilities
*
* @package OCA\Files_Trashbin
*/
class Capabilities {
/**
* @return \OC_OCS_Result
*/
public static function getCapabilities() {
return new \OC_OCS_Result(array(
'capabilities' => array(
'files' => array(
'undelete' => true,
),
),
));
}
}