From e876d5fc91501ac093faa181e8c9076ca64f2023 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 4 Aug 2018 03:04:00 +0200 Subject: util.pubsub: Look for a configured callback for more complicated access models --- util/pubsub.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'util') diff --git a/util/pubsub.lua b/util/pubsub.lua index 13e68280..f1d1df38 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -121,6 +121,16 @@ function service:get_default_affiliation(node, actor, action) -- luacheck: ignor elseif access_model == "whitelist" then return "none"; end + + if self.config.access_models then + local check = self.config.access_models[access_model]; + if check then + local aff = check(actor); + if aff then + return aff; + end + end + end end function service:set_affiliation(node, actor, jid, affiliation) -- cgit v1.2.3