Skip to content
Snippets Groups Projects
Unverified Commit 17f1653c authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

If not in debug disable principal listing


Trashbin and Version should have the same behaviour as the other
collections.

Signed-off-by: default avatarRoeland Jago Douma <roeland@famdouma.nl>
parent 7d3e7f43
No related branches found
No related tags found
No related merge requests found
...@@ -23,14 +23,17 @@ declare(strict_types=1); ...@@ -23,14 +23,17 @@ declare(strict_types=1);
*/ */
namespace OCA\Files_Trashbin\Sabre; namespace OCA\Files_Trashbin\Sabre;
use OCP\IConfig;
use Sabre\DAV\INode; use Sabre\DAV\INode;
use Sabre\DAVACL\AbstractPrincipalCollection; use Sabre\DAVACL\AbstractPrincipalCollection;
use Sabre\DAVACL\PrincipalBackend; use Sabre\DAVACL\PrincipalBackend;
class RootCollection extends AbstractPrincipalCollection { class RootCollection extends AbstractPrincipalCollection {
public function __construct(PrincipalBackend\BackendInterface $principalBackend) { public function __construct(PrincipalBackend\BackendInterface $principalBackend, IConfig $config) {
parent::__construct($principalBackend, 'principals/users'); parent::__construct($principalBackend, 'principals/users');
$this->disableListing = !$config->getSystemValue('debug', false);
} }
/** /**
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
namespace OCA\Files_Versions\Sabre; namespace OCA\Files_Versions\Sabre;
use OCP\Files\IRootFolder; use OCP\Files\IRootFolder;
use OCP\IConfig;
use Sabre\DAV\INode; use Sabre\DAV\INode;
use Sabre\DAVACL\AbstractPrincipalCollection; use Sabre\DAVACL\AbstractPrincipalCollection;
use Sabre\DAVACL\PrincipalBackend; use Sabre\DAVACL\PrincipalBackend;
...@@ -33,10 +34,13 @@ class RootCollection extends AbstractPrincipalCollection { ...@@ -33,10 +34,13 @@ class RootCollection extends AbstractPrincipalCollection {
private $rootFolder; private $rootFolder;
public function __construct(PrincipalBackend\BackendInterface $principalBackend, public function __construct(PrincipalBackend\BackendInterface $principalBackend,
IRootFolder $rootFolder) { IRootFolder $rootFolder,
IConfig $config) {
parent::__construct($principalBackend, 'principals/users'); parent::__construct($principalBackend, 'principals/users');
$this->rootFolder = $rootFolder; $this->rootFolder = $rootFolder;
$this->disableListing = !$config->getSystemValue('debug', false);
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment