Software /
code /
prosody
Changeset
13782:4cfabfbb0691 13.0
core.usermanager: Fix COMPAT layer for legacy is_admin() function
Thanks ctrlaltca
Fixes #1912
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 22 Mar 2025 11:53:15 +0100 |
parents | 13781:97bbe60336bc |
children | 13783:833fa5d08d13 13784:b30eaa74d35b |
files | core/usermanager.lua |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/core/usermanager.lua Wed Mar 19 16:15:52 2025 +0100 +++ b/core/usermanager.lua Sat Mar 22 11:53:15 2025 +0100 @@ -307,7 +307,8 @@ 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)