From: lain Date: Tue, 20 Feb 2018 17:54:13 +0000 (+0100) Subject: Allow moderators to delete posts. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=eec6a87dbb1186349c766c88829ad121588bb43b;p=akkoma Allow moderators to delete posts. --- diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index d3a9f7b85..849360a16 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -8,7 +8,7 @@ defmodule Pleroma.Web.CommonAPI do def delete(activity_id, user) do with %Activity{data: %{"object" => %{"id" => object_id}}} <- Repo.get(Activity, activity_id), %Object{} = object <- Object.get_by_ap_id(object_id), - true <- user.ap_id == object.data["actor"], + true <- user.info["is_moderator"] || (user.ap_id == object.data["actor"]), {:ok, delete} <- ActivityPub.delete(object) do {:ok, delete} end