mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
Allow pubsub node owner to overwrite items published by other persons
Owner is already permitted to delete those items, so it could do that by deleting old item, and publishing it again, so i don't see reason to not allow that overwrite.
This commit is contained in:
parent
12d47455ba
commit
f75909db4c
@ -385,6 +385,13 @@ publish_item(Nidx, Publisher, PublishModel, MaxItems, ItemId, Payload,
|
||||
modification = {Now, SubKey},
|
||||
payload = Payload}),
|
||||
{result, {default, broadcast, []}};
|
||||
% Allow node owner to modify any item, he can also delete it and recreate
|
||||
{result, #pubsub_item{creation = {CreationTime, _}} = OldItem} when Affiliation == owner->
|
||||
set_item(OldItem#pubsub_item{
|
||||
creation = {CreationTime, GenKey},
|
||||
modification = {Now, SubKey},
|
||||
payload = Payload}),
|
||||
{result, {default, broadcast, []}};
|
||||
{result, _} ->
|
||||
{error, xmpp:err_forbidden()};
|
||||
_ ->
|
||||
|
@ -257,6 +257,13 @@ publish_item(Nidx, Publisher, PublishModel, MaxItems, ItemId, Payload,
|
||||
modification = {Now, SubKey},
|
||||
payload = Payload}),
|
||||
{result, {default, broadcast, []}};
|
||||
% Allow node owner to modify any item, he can also delete it and recreate
|
||||
{result, #pubsub_item{creation = {CreationTime, _}} = OldItem} when Affiliation == owner->
|
||||
set_item(OldItem#pubsub_item{
|
||||
creation = {CreationTime, GenKey},
|
||||
modification = {Now, SubKey},
|
||||
payload = Payload}),
|
||||
{result, {default, broadcast, []}};
|
||||
{result, _} ->
|
||||
{error, xmpp:err_forbidden()};
|
||||
_ ->
|
||||
|
Loading…
Reference in New Issue
Block a user