aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-05-22 01:32:44 +0200
committerKim Alvefur <zash@zash.se>2018-05-22 01:32:44 +0200
commitee883aff478f701f9c6411ed5f9bc9df562acc6f (patch)
tree1690e39a441fd176f0621583f7f03eafb54e7d1e
parentcc6d427f216a5ebe16c8c87d60b91d3b0de29949 (diff)
downloadprosody-ee883aff478f701f9c6411ed5f9bc9df562acc6f.tar.gz
prosody-ee883aff478f701f9c6411ed5f9bc9df562acc6f.zip
util.pubsub: Also check for affiliation set on bare JID
This fixes eg publishing from a full JID when the affiliation has been set on the bare JID, as would be common in XMPP.
-rw-r--r--util/pubsub.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua
index 7cf376ef..86dd8e14 100644
--- a/util/pubsub.lua
+++ b/util/pubsub.lua
@@ -75,7 +75,8 @@ function service:may(node, actor, action)
if actor == true then return true; end
local node_obj = self.nodes[node];
- local node_aff = node_obj and node_obj.affiliations[actor];
+ local node_aff = node_obj and (node_obj.affiliations[actor]
+ or node_obj.affiliations[self.config.normalize_jid(actor)]);
local service_aff = self.affiliations[actor]
or self.config.get_affiliation(actor, node, action)
or "none";