summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/Group_Proxy.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-11-21 20:20:16 +0100
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-12-04 18:52:19 +0000
commitd8215fbcee5934e48585938ffc587bbe76d9c758 (patch)
tree2f9fc0f0a76ecde0eebb62834d756f4bf5577b52 /apps/user_ldap/lib/Group_Proxy.php
parent9ab80200357e85b204ca29a3bac66ed4419357e5 (diff)
downloadnextcloud-server-d8215fbcee5934e48585938ffc587bbe76d9c758.tar.gz
nextcloud-server-d8215fbcee5934e48585938ffc587bbe76d9c758.zip
enh(LDAP): implement IIsAdmin interface
- add configuration to specify one LDAP group acting as admin group (CLI) - implement `isAdmin()` method, basically relying on inGroup against the configured group Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib/Group_Proxy.php')
-rw-r--r--apps/user_ldap/lib/Group_Proxy.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php
index a5e5c6c1413..73daf4fdd77 100644
--- a/apps/user_ldap/lib/Group_Proxy.php
+++ b/apps/user_ldap/lib/Group_Proxy.php
@@ -33,12 +33,13 @@ use OCP\Group\Backend\IBatchMethodsBackend;
use OCP\Group\Backend\IDeleteGroupBackend;
use OCP\Group\Backend\IGetDisplayNameBackend;
use OCP\Group\Backend\IGroupDetailsBackend;
+use OCP\Group\Backend\IIsAdminBackend;
use OCP\Group\Backend\INamedBackend;
use OCP\GroupInterface;
use OCP\IConfig;
use OCP\IUserManager;
-class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGetDisplayNameBackend, INamedBackend, IDeleteGroupBackend, IBatchMethodsBackend {
+class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGetDisplayNameBackend, INamedBackend, IDeleteGroupBackend, IBatchMethodsBackend, IIsAdminBackend {
private $backends = [];
private ?Group_LDAP $refBackend = null;
private Helper $helper;
@@ -396,4 +397,8 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
public function addRelationshipToCaches(string $uid, ?string $dnUser, string $gid): void {
$this->handleRequest($gid, 'addRelationshipToCaches', [$uid, $dnUser, $gid]);
}
+
+ public function isAdmin(string $uid): bool {
+ return $this->handleRequest($uid, 'isAdmin', [$uid]);
+ }
}