# HG changeset patch # User Kim Alvefur # Date 1533489169 -7200 # Node ID 01fc8ba0a7fa64604c23056ac6681f120caf2cb3 # Parent 5444d4a8ad905975f611a416c3bd89abd1e24855 mod_pubsub: Use util.pubsub API for retrieving node config instead Normalizes access control to the 'get_configuration' capability Thanks pep. diff -r 5444d4a8ad90 -r 01fc8ba0a7fa plugins/mod_pubsub/pubsub.lib.lua --- a/plugins/mod_pubsub/pubsub.lib.lua Sun Aug 05 19:12:29 2018 +0200 +++ b/plugins/mod_pubsub/pubsub.lib.lua Sun Aug 05 19:12:49 2018 +0200 @@ -632,18 +632,12 @@ return true; end - if not service:may(node, stanza.attr.from, "configure") then - origin.send(pubsub_error_reply(stanza, "forbidden")); + local ok, node_config = service:get_node_config(node, stanza.attr.from); + if not ok then + origin.send(pubsub_error_reply(stanza, node_config)); return true; end - local node_obj = service.nodes[node]; - if not node_obj then - origin.send(pubsub_error_reply(stanza, "item-not-found")); - return true; - end - - local node_config = node_obj.config; local pubsub_form_data = config_to_xep0060(node_config); local reply = st.reply(stanza) :tag("pubsub", { xmlns = xmlns_pubsub_owner })