Fix CommonAPI delete function to use User.privileged? instead of User.superuser?
This commit is contained in:
parent
60df2d8a97
commit
c58eb873dd
1 changed files with 1 additions and 1 deletions
|
@ -148,7 +148,7 @@ defmodule Pleroma.Web.CommonAPI do
|
||||||
true <- User.privileged?(user, :messages_delete) || user.ap_id == object.data["actor"],
|
true <- User.privileged?(user, :messages_delete) || user.ap_id == object.data["actor"],
|
||||||
{:ok, delete_data, _} <- Builder.delete(user, object.data["id"]),
|
{:ok, delete_data, _} <- Builder.delete(user, object.data["id"]),
|
||||||
{:ok, delete, _} <- Pipeline.common_pipeline(delete_data, local: true) do
|
{:ok, delete, _} <- Pipeline.common_pipeline(delete_data, local: true) do
|
||||||
if User.superuser?(user) and user.ap_id != object.data["actor"] do
|
if User.privileged?(user, :messages_delete) and user.ap_id != object.data["actor"] do
|
||||||
action =
|
action =
|
||||||
if object.data["type"] == "ChatMessage" do
|
if object.data["type"] == "ChatMessage" do
|
||||||
"chat_message_delete"
|
"chat_message_delete"
|
||||||
|
|
Loading…
Reference in a new issue