Merge pull request #12276 from owncloud/undelete-only-if-files-trashin-is-enabled

Only show undelete capability if files_trashbin is enabled
This commit is contained in:
Morris Jobke 2014-11-19 11:42:19 +01:00
commit dc9eaf59dc
3 changed files with 36 additions and 1 deletions

View File

@ -15,7 +15,6 @@ class Capabilities {
'capabilities' => array( 'capabilities' => array(
'files' => array( 'files' => array(
'bigfilechunking' => true, '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'); ->actionInclude('files_trashbin/ajax/list.php');
$this->create('files_trashbin_ajax_undelete', 'ajax/undelete.php') $this->create('files_trashbin_ajax_undelete', 'ajax/undelete.php')
->actionInclude('files_trashbin/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,
),
),
));
}
}