From: William Pitcock Date: Tue, 20 Nov 2018 18:42:28 +0000 (+0000) Subject: common api: fix moderator check when deleting posts X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=4ac849cb4ad1ce10b4d8edd5c371f225c17ce757;p=akkoma common api: fix moderator check when deleting posts --- diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index 77e4dbbd7..e9bad8d04 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.normalize(object_id), - true <- user.info["is_moderator"] || 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