commit: c58eb873dd47ebd1b207c9f79ccffe2c3819949d
parent 60df2d8a97325367a1ad40a30fd072f5dc1e805c
Author: Sean King <seanking2919@protonmail.com>
Date: Sun, 18 Dec 2022 22:05:07 -0700
Fix CommonAPI delete function to use User.privileged? instead of User.superuser?
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/pleroma/web/common_api.ex b/lib/pleroma/web/common_api.ex
@@ -148,7 +148,7 @@ defmodule Pleroma.Web.CommonAPI do
true <- User.privileged?(user, :messages_delete) || user.ap_id == object.data["actor"],
{:ok, delete_data, _} <- Builder.delete(user, object.data["id"]),
{: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 =
if object.data["type"] == "ChatMessage" do
"chat_message_delete"