Changeset

5290:dddac5a3f447

mod_vcard_muc: take roles into account for access check This allows admins on the MUC component to force-set avatars, even if they are not owners in a particular MUC, similar to how they are granted auto-ownership in other contexts.
author Jonas Schäfer <jonas@wielicki.name>
date Wed, 29 Mar 2023 17:52:21 +0200
parents 5289:308024be6d6f
children 5291:2aecad5a6c54
files mod_vcard_muc/mod_vcard_muc.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_vcard_muc/mod_vcard_muc.lua	Wed Mar 29 17:21:45 2023 +0200
+++ b/mod_vcard_muc/mod_vcard_muc.lua	Wed Mar 29 17:52:21 2023 +0200
@@ -76,7 +76,7 @@
 			session.send(st.error_reply(stanza, "cancel", "item-not-found"));
 		end
 	else
-		if from_affiliation == "owner" then
+		if from_affiliation == "owner" or (module.may and module:may("muc:automatic-ownership", from)) then
 			if vcards:set(room_node, st.preserialize(stanza.tags[1])) then
 				session.send(st.reply(stanza):tag("vCard", { xmlns = "vcard-temp" }));
 				broadcast_presence(room, nil)