aboutsummaryrefslogtreecommitdiffstats
path: root/util/pubsub.lua
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
commitbf88bf5c59e1112b049e8bacd0b1f6f2d63e064c (patch)
tree1690e39a441fd176f0621583f7f03eafb54e7d1e /util/pubsub.lua
parent542e4301f6073f045444a3163eb320bf1c70b582 (diff)
downloadprosody-bf88bf5c59e1112b049e8bacd0b1f6f2d63e064c.tar.gz
prosody-bf88bf5c59e1112b049e8bacd0b1f6f2d63e064c.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.
Diffstat (limited to 'util/pubsub.lua')
-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";