Changeset

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
parents 13539:006fbd0f0c2f
children 13541:3dc3781d02cd
files plugins/mod_admin_shell.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
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]]