# HG changeset patch # User Kim Alvefur # Date 1655327057 -7200 # Node ID a741183eec97b7d40f275dec9489d02e7dd5c6d7 # Parent 4262ce516e6c07f312c68a37dffbc55e97c15b4f core.moduleapi: Expand permission name ':' prefix earlier Ensures it applies to the context as string case Somehow this fixes everything diff -r 4262ce516e6c -r a741183eec97 core/moduleapi.lua --- a/core/moduleapi.lua Wed Jun 15 23:03:15 2022 +0200 +++ b/core/moduleapi.lua Wed Jun 15 23:04:17 2022 +0200 @@ -615,6 +615,9 @@ end function api:may(action, context) + if action:byte(1) == 58 then -- action begins with ':' + action = self.name..action; -- prepend module name + end if type(context) == "string" then -- check JID permissions local role; local node, host = jid_split(context); @@ -638,9 +641,6 @@ if not session then error("Unable to identify actor session from context"); end - if action:byte(1) == 58 then -- action begins with ':' - action = self.name..action; -- prepend module name - end if session.type == "s2sin" or (session.type == "c2s" and session.host ~= self.host) then local actor_jid = context.stanza.attr.from; local role = hosts[self.host].authz.get_jid_role(actor_jid);