diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2024-01-11 13:28:25 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2024-02-19 18:57:22 +0100 |
commit | c98b0462e33011a99aeaba582d82e52fdb14c3ae (patch) | |
tree | fdb3717c78d8d6e3b82207b0b5cb88ff40a95313 /lib/private/Group | |
parent | 1bc8129623d15b369a7b6bf7ac65931b0e83455e (diff) | |
download | nextcloud-server-c98b0462e33011a99aeaba582d82e52fdb14c3ae.tar.gz nextcloud-server-c98b0462e33011a99aeaba582d82e52fdb14c3ae.zip |
fix(admin role): fix old and wrong way to determine whether user is admin
- fixes Settings knowing who is an admin of non-local group backend groups
- obsoletes and removes a little old, deprecated code
- double checks proper parameter type on Group\Manager::isAdmin
- also fixes legacy OC_User code to check whether user is an admin
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/Group')
-rw-r--r-- | lib/private/Group/Manager.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index eb9daebb222..dafbe4295a4 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -52,6 +52,7 @@ use OCP\IGroup; use OCP\IGroupManager; use OCP\IUser; use Psr\Log\LoggerInterface; +use function is_string; /** * Class Manager @@ -356,7 +357,7 @@ class Manager extends PublicEmitter implements IGroupManager { */ public function isAdmin($userId) { foreach ($this->backends as $backend) { - if ($backend->implementsActions(Backend::IS_ADMIN) && $backend->isAdmin($userId)) { + if (is_string($userId) && $backend->implementsActions(Backend::IS_ADMIN) && $backend->isAdmin($userId)) { return true; } } |