Comparison

util/pubsub.lua @ 9098:d5bc306e93aa

util.pubsub: Look for a configured callback for more complicated access models
author Kim Alvefur <zash@zash.se>
date Sat, 04 Aug 2018 03:04:00 +0200
parent 9095:5639dc1a3f85
child 9104:e1ca373a7e09
comparison
equal deleted inserted replaced
9097:ce2ba9f91c84 9098:d5bc306e93aa
118 118
119 if access_model == "open" then 119 if access_model == "open" then
120 return "subscriber"; 120 return "subscriber";
121 elseif access_model == "whitelist" then 121 elseif access_model == "whitelist" then
122 return "none"; 122 return "none";
123 end
124
125 if self.config.access_models then
126 local check = self.config.access_models[access_model];
127 if check then
128 local aff = check(actor);
129 if aff then
130 return aff;
131 end
132 end
123 end 133 end
124 end 134 end
125 135
126 function service:set_affiliation(node, actor, jid, affiliation) 136 function service:set_affiliation(node, actor, jid, affiliation)
127 -- Access checking 137 -- Access checking