Comparison

plugins/mod_pep.lua @ 9103:d5a7d2697b19

mod_pep: Restrict access models to 'presence', 'whitelist' and 'open' 'roster' needs additional support to inspect roster groups 'authorize' is not implemented
author Kim Alvefur <zash@zash.se>
date Sat, 04 Aug 2018 03:40:30 +0200
parent 9099:974b25c27f24
child 9113:74639d606a15
comparison
equal deleted inserted replaced
9102:f3a1ecc46f20 9103:d5a7d2697b19
40 return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item"; 40 return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item";
41 end 41 end
42 42
43 function check_node_config(node, actor, new_config) -- luacheck: ignore 212/node 212/actor 43 function check_node_config(node, actor, new_config) -- luacheck: ignore 212/node 212/actor
44 if (new_config["max_items"] or 1) > max_max_items then 44 if (new_config["max_items"] or 1) > max_max_items then
45 return false;
46 end
47 if new_config["access_model"] ~= "presence"
48 and new_config["access_model"] ~= "whitelist"
49 and new_config["access_model"] ~= "open" then
45 return false; 50 return false;
46 end 51 end
47 return true; 52 return true;
48 end 53 end
49 54