# HG changeset patch # User Kim Alvefur # Date 1533344640 -7200 # Node ID d5bc306e93aa39de7551b7ca29aa022f4e2f5c7d # Parent ce2ba9f91c8449054f75e1a44513fee9f11d4d05 util.pubsub: Look for a configured callback for more complicated access models diff -r ce2ba9f91c84 -r d5bc306e93aa util/pubsub.lua --- a/util/pubsub.lua Sat Aug 04 03:38:55 2018 +0200 +++ b/util/pubsub.lua Sat Aug 04 03:04:00 2018 +0200 @@ -121,6 +121,16 @@ 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)