Software /
code /
prosody-modules
Changeset
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 | 5159:51f7d72a56c2 |
children | 5161:6af2d74daa15 |
files | mod_firewall/mod_firewall.lua |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_firewall/mod_firewall.lua Wed Jan 25 20:39:13 2023 +0100 +++ b/mod_firewall/mod_firewall.lua Fri Jan 27 23:06:25 2023 +0100 @@ -184,7 +184,7 @@ group_contains = { global_code = [[local group_contains = module:depends("groups").group_contains]]; }; - is_admin = features:contains("permissions") and { global_code = [[local is_admin = require "core.usermanager".is_admin;]]} or nil; + is_admin = require"core.usermanager".is_admin and { global_code = [[local is_admin = require "core.usermanager".is_admin;]]} or nil; get_jid_role = require "core.usermanager".get_jid_role and { global_code = [[local get_jid_role = require "core.usermanager".get_jid_role;]] } or nil; core_post_stanza = { global_code = [[local core_post_stanza = prosody.core_post_stanza;]] }; zone = { global_code = function (zone)