projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5bc810c
)
Allow moderators to delete posts.
author
lain
<lain@soykaf.club>
Tue, 20 Feb 2018 17:54:13 +0000
(18:54 +0100)
committer
lain
<lain@soykaf.club>
Tue, 20 Feb 2018 17:54:13 +0000
(18:54 +0100)
lib/pleroma/web/common_api/common_api.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/common_api/common_api.ex
b/lib/pleroma/web/common_api/common_api.ex
index d3a9f7b8500631f555864a1d4e23e67058e4dbb6..849360a1694b157a36c2cb97988f05d7ec249cd1 100644
(file)
--- 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