Merge pull request #9427 from nextcloud/bugfix/noid/no_listing_if_not_in_debug_trash_version

If not in debug disable principal listing
This commit is contained in:
Roeland Jago Douma 2018-05-10 09:31:19 +02:00 committed by GitHub
commit 48034bdc4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -23,14 +23,17 @@ declare(strict_types=1);
*/
namespace OCA\Files_Trashbin\Sabre;
use OCP\IConfig;
use Sabre\DAV\INode;
use Sabre\DAVACL\AbstractPrincipalCollection;
use Sabre\DAVACL\PrincipalBackend;
class RootCollection extends AbstractPrincipalCollection {
public function __construct(PrincipalBackend\BackendInterface $principalBackend) {
public function __construct(PrincipalBackend\BackendInterface $principalBackend, IConfig $config) {
parent::__construct($principalBackend, 'principals/users');
$this->disableListing = !$config->getSystemValue('debug', false);
}
/**

View File

@ -23,6 +23,7 @@
namespace OCA\Files_Versions\Sabre;
use OCP\Files\IRootFolder;
use OCP\IConfig;
use Sabre\DAV\INode;
use Sabre\DAVACL\AbstractPrincipalCollection;
use Sabre\DAVACL\PrincipalBackend;
@ -33,10 +34,13 @@ class RootCollection extends AbstractPrincipalCollection {
private $rootFolder;
public function __construct(PrincipalBackend\BackendInterface $principalBackend,
IRootFolder $rootFolder) {
IRootFolder $rootFolder,
IConfig $config) {
parent::__construct($principalBackend, 'principals/users');
$this->rootFolder = $rootFolder;
$this->disableListing = !$config->getSystemValue('debug', false);
}
/**