mirror of
https://github.com/processone/ejabberd
synced 2025-10-05 19:42:11 +02:00
PubSub: fix error type on item deletion with insufficient priviledge
This commit is contained in:
parent
6f538545b4
commit
a42bf67957
2 changed files with 10 additions and 10 deletions
|
@ -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, ?ERR_FORBIDDEN};
|
||||
true ->
|
||||
|
|
|
@ -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 ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue