diff options
author | Christophe Romain <christophe.romain@process-one.net> | 2016-09-29 11:20:56 +0200 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2016-09-30 07:51:17 +0300 |
commit | 7566e267a757146e0b333429010aed922ad57766 (patch) | |
tree | 6e05155be19ab313e85862df7296fe314aead644 /src/node_flat.erl | |
parent | Text legacy IQ handler support (diff) |
PubSub: fix error type on item deletion with insufficient priviledge
Diffstat (limited to 'src/node_flat.erl')
-rw-r--r-- | src/node_flat.erl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/node_flat.erl b/src/node_flat.erl index e80aaad34..e3170a263 100644 --- a/src/node_flat.erl +++ b/src/node_flat.erl @@ -419,11 +419,11 @@ delete_item(Nidx, Publisher, PublishModel, ItemId) -> #pubsub_state{affiliation = Affiliation, items = Items} = GenState, Allowed = Affiliation == publisher orelse Affiliation == owner orelse - PublishModel == open orelse - case get_item(Nidx, ItemId) of - {result, #pubsub_item{creation = {_, GenKey}}} -> true; - _ -> false - end, + (PublishModel == open andalso + case get_item(Nidx, ItemId) of + {result, #pubsub_item{creation = {_, GenKey}}} -> true; + _ -> false + end), if not Allowed -> {error, xmpp:err_forbidden()}; true -> |