Mercurial > prosody-modules
comparison mod_firewall/mod_firewall.lua @ 5160:8474a3b80200
mod_firewall: Fix 'is_admin' internal dependency rule #1797 (thanks diane)
Looks like the boolean logic was inverted here. Instead, for now,
simply check if is_admin is there. It is deprecated in trunk and was
briefly removed before being brought back with a 'deprecated' warning as
part of the new roles and permissions work. Making this dependency
conditioned on the existence of the underlying function should make it
work until it actually goes away for real.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 27 Jan 2023 23:06:25 +0100 |
parents | 84997bc3f92e |
children | 32a9817c7516 |
comparison
equal
deleted
inserted
replaced
5159:51f7d72a56c2 | 5160:8474a3b80200 |
---|---|
182 bare_to = { depends = { "jid_bare", "to" }, local_code = "local bare_to = jid_bare(to)"}; | 182 bare_to = { depends = { "jid_bare", "to" }, local_code = "local bare_to = jid_bare(to)"}; |
183 bare_from = { depends = { "jid_bare", "from" }, local_code = "local bare_from = jid_bare(from)"}; | 183 bare_from = { depends = { "jid_bare", "from" }, local_code = "local bare_from = jid_bare(from)"}; |
184 group_contains = { | 184 group_contains = { |
185 global_code = [[local group_contains = module:depends("groups").group_contains]]; | 185 global_code = [[local group_contains = module:depends("groups").group_contains]]; |
186 }; | 186 }; |
187 is_admin = features:contains("permissions") and { global_code = [[local is_admin = require "core.usermanager".is_admin;]]} or nil; | 187 is_admin = require"core.usermanager".is_admin and { global_code = [[local is_admin = require "core.usermanager".is_admin;]]} or nil; |
188 get_jid_role = require "core.usermanager".get_jid_role and { global_code = [[local get_jid_role = require "core.usermanager".get_jid_role;]] } or nil; | 188 get_jid_role = require "core.usermanager".get_jid_role and { global_code = [[local get_jid_role = require "core.usermanager".get_jid_role;]] } or nil; |
189 core_post_stanza = { global_code = [[local core_post_stanza = prosody.core_post_stanza;]] }; | 189 core_post_stanza = { global_code = [[local core_post_stanza = prosody.core_post_stanza;]] }; |
190 zone = { global_code = function (zone) | 190 zone = { global_code = function (zone) |
191 local var = zone; | 191 local var = zone; |
192 if var == "$local" then | 192 if var == "$local" then |