aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/AccessFactory.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/lib/AccessFactory.php')
-rw-r--r--apps/user_ldap/lib/AccessFactory.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/AccessFactory.php b/apps/user_ldap/lib/AccessFactory.php
new file mode 100644
index 00000000000..da114c467a7
--- /dev/null
+++ b/apps/user_ldap/lib/AccessFactory.php
@@ -0,0 +1,44 @@
+<?php
+
+/**
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCA\User_LDAP;
+
+use OCA\User_LDAP\User\Manager;
+use OCP\EventDispatcher\IEventDispatcher;
+use OCP\IAppConfig;
+use OCP\IConfig;
+use OCP\IUserManager;
+use OCP\Server;
+use Psr\Log\LoggerInterface;
+
+class AccessFactory {
+
+ public function __construct(
+ private ILDAPWrapper $ldap,
+ private Helper $helper,
+ private IConfig $config,
+ private IAppConfig $appConfig,
+ private IUserManager $ncUserManager,
+ private LoggerInterface $logger,
+ private IEventDispatcher $dispatcher,
+ ) {
+ }
+
+ public function get(Connection $connection): Access {
+ /* Each Access instance gets its own Manager instance, see OCA\User_LDAP\AppInfo\Application::register() */
+ return new Access(
+ $this->ldap,
+ $connection,
+ Server::get(Manager::class),
+ $this->helper,
+ $this->config,
+ $this->ncUserManager,
+ $this->logger,
+ $this->appConfig,
+ $this->dispatcher,
+ );
+ }
+}