From 577e6d837003adf5393c89802f028145cccec54c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 1 Nov 2024 13:07:25 +0100 Subject: mod_admin_shell: Allow assigning roles to arbitrary JIDs when supported mod_authz_internal does not support this --- plugins/mod_admin_shell.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index e6b44f00..3738b8ba 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -1770,7 +1770,11 @@ function def_env.user:setrole(jid, host, new_role) elseif prosody.hosts[userhost] and not um.user_exists(username, userhost) then return nil, "No such user"; end - return um.set_user_role(username, host, new_role); + if userhost == host then + return um.set_user_role(username, userhost, new_role); + else + return um.set_jid_role(jid, host, new_role); + end end describe_command [[user:addrole(jid, host, role) - Add a secondary role to a user]] -- cgit v1.2.3