diff options
author | Kim Alvefur <zash@zash.se> | 2024-11-01 13:07:25 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2024-11-01 13:07:25 +0100 |
commit | 577e6d837003adf5393c89802f028145cccec54c (patch) | |
tree | f9e3b08103994ccaf51c1b837a5bcbd75eaedc32 /plugins | |
parent | 77833e7394d1711bd175565a010fa06bbbc220a4 (diff) | |
download | prosody-577e6d837003adf5393c89802f028145cccec54c.tar.gz prosody-577e6d837003adf5393c89802f028145cccec54c.zip |
mod_admin_shell: Allow assigning roles to arbitrary JIDs when supported
mod_authz_internal does not support this
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_admin_shell.lua | 6 |
1 files changed, 5 insertions, 1 deletions
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]] |