Changeset

13308:d539cb48c6e9

mod_muc: Switch to module:could() for some implicit access control checks
author Matthew Wild <mwild1@gmail.com>
date Tue, 07 Nov 2023 11:50:59 +0000
parents 13307:8fb8a253f0a1
children 13309:113ce2ac73a2
files plugins/muc/mod_muc.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/mod_muc.lua	Tue Nov 07 11:12:57 2023 +0000
+++ b/plugins/muc/mod_muc.lua	Tue Nov 07 11:50:59 2023 +0000
@@ -123,13 +123,13 @@
 	-- Monkey patch to make server admins room owners
 	local _get_affiliation = room_mt.get_affiliation;
 	function room_mt:get_affiliation(jid)
-		if module:may(":automatic-ownership", jid) then return "owner"; end
+		if module:could(":automatic-ownership", jid) then return "owner"; end
 		return _get_affiliation(self, jid);
 	end
 
 	local _set_affiliation = room_mt.set_affiliation;
 	function room_mt:set_affiliation(actor, jid, affiliation, reason, data)
-		if affiliation ~= "owner" and module:may(":automatic-ownership", jid) then return nil, "modify", "not-acceptable"; end
+		if affiliation ~= "owner" and module:could(":automatic-ownership", jid) then return nil, "modify", "not-acceptable"; end
 		return _set_affiliation(self, actor, jid, affiliation, reason, data);
 	end
 end