diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-09-06 19:50:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-06 19:50:52 +0200 |
commit | a10c4517cbb20625b5ee32c1809bee40ecbb5456 (patch) | |
tree | ed81a72e616ac7cb5b833e90f47af3bd90e677e2 /lib/private/Group | |
parent | 6be8642c59d59a76e0ed3586da029cd88a0a9be4 (diff) | |
parent | 586cefc4f17fe48320db2c56c6f62b01ae33c4d6 (diff) | |
download | nextcloud-server-a10c4517cbb20625b5ee32c1809bee40ecbb5456.tar.gz nextcloud-server-a10c4517cbb20625b5ee32c1809bee40ecbb5456.zip |
Merge pull request #5571 from Luzifer/5570_backend_admin
Allow group backend to declare users as admins
Diffstat (limited to 'lib/private/Group')
-rw-r--r-- | lib/private/Group/Backend.php | 1 | ||||
-rw-r--r-- | lib/private/Group/Manager.php | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/Group/Backend.php b/lib/private/Group/Backend.php index 1e8d62f5e42..001d8d9da66 100644 --- a/lib/private/Group/Backend.php +++ b/lib/private/Group/Backend.php @@ -38,6 +38,7 @@ abstract class Backend implements \OCP\GroupInterface { self::REMOVE_FROM_GOUP => 'removeFromGroup', self::COUNT_USERS => 'countUsersInGroup', self::GROUP_DETAILS => 'getGroupDetails', + self::IS_ADMIN => 'isAdmin', ]; /** diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index 6d4f5a091c6..15d83380acf 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -288,6 +288,11 @@ class Manager extends PublicEmitter implements IGroupManager { * @return bool if admin */ public function isAdmin($userId) { + foreach ($this->backends as $backend) { + if ($backend->implementsActions(\OC\Group\Backend::IS_ADMIN) && $backend->isAdmin($userId)) { + return true; + } + } return $this->isInGroup($userId, 'admin'); } |