Software / code / prosody
Diff
plugins/mod_admin_shell.lua @ 13540:cc67109ce502
mod_admin_shell: Allow assigning roles to arbitrary JIDs when supported
mod_authz_internal does not support this
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 01 Nov 2024 13:07:25 +0100 |
| parent | 13517:4bf889e94831 |
| child | 13542:67288253d9a2 |
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua Thu Oct 31 17:18:43 2024 +0100 +++ b/plugins/mod_admin_shell.lua Fri Nov 01 13:07:25 2024 +0100 @@ -1770,7 +1770,11 @@ 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]]