From a42bf67957c18d66c05fac3f651ab198b59bef06 Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Thu, 29 Sep 2016 11:20:56 +0200 Subject: PubSub: fix error type on item deletion with insufficient priviledge --- src/node_flat_sql.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/node_flat_sql.erl') diff --git a/src/node_flat_sql.erl b/src/node_flat_sql.erl index 86375eaec..e7e5fb417 100644 --- a/src/node_flat_sql.erl +++ b/src/node_flat_sql.erl @@ -271,11 +271,11 @@ delete_item(Nidx, Publisher, PublishModel, ItemId) -> {result, Affiliation} = get_affiliation(Nidx, GenKey), 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, ?ERR_FORBIDDEN}; true -> -- cgit v1.2.3