aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/mod_muc.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2023-11-07 11:50:59 +0000
committerMatthew Wild <mwild1@gmail.com>2023-11-07 11:50:59 +0000
commit836b370fa8d6fc04347a33642cedaa918d00f464 (patch)
tree879c77f2d05ac90aab0e87d170a6bcf214a48c44 /plugins/muc/mod_muc.lua
parent3eff243580ddc3d5e528b7a5308bd27cba13603a (diff)
downloadprosody-836b370fa8d6fc04347a33642cedaa918d00f464.tar.gz
prosody-836b370fa8d6fc04347a33642cedaa918d00f464.zip
mod_muc: Switch to module:could() for some implicit access control checks
Diffstat (limited to 'plugins/muc/mod_muc.lua')
-rw-r--r--plugins/muc/mod_muc.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 8eac4c1e..b3f30eed 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -123,13 +123,13 @@ if module:get_option_boolean("component_admins_as_room_owners", true) then
-- 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