aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2025-03-22 11:53:15 +0100
committerKim Alvefur <zash@zash.se>2025-03-22 11:53:15 +0100
commit6959547703da2b8137005e391863e7e6399109a6 (patch)
treea1d7246ed4d066c7219f4b4ff54aea2081f81572 /core
parent0ed2d38edf5154c4a892ba1e0f6caf645ec302de (diff)
downloadprosody-6959547703da2b8137005e391863e7e6399109a6.tar.gz
prosody-6959547703da2b8137005e391863e7e6399109a6.zip
core.usermanager: Fix COMPAT layer for legacy is_admin() function
Thanks ctrlaltca Fixes #1912
Diffstat (limited to 'core')
-rw-r--r--core/usermanager.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/usermanager.lua b/core/usermanager.lua
index c179e21b..beac547d 100644
--- a/core/usermanager.lua
+++ b/core/usermanager.lua
@@ -307,7 +307,8 @@ local function is_admin(jid, host)
end
log("warn", "Usage of legacy is_admin() API, which will be disabled in a future build: %s", debug.traceback());
log("warn", "See https://prosody.im/doc/developers/permissions about the new permissions API");
- return legacy_admin_roles[get_jid_role(jid, host)] or false;
+ local role = get_jid_role(jid, host);
+ return role and legacy_admin_roles[role.name] or false;
end
local function get_users_with_role(role, host)