From 47fcec86eaaf3ea237e59e99a26369f1427a8d1f Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Fri, 3 Jan 2020 14:36:57 -0500 Subject: [PATCH] fix inability to delete comment contents --- lib/philomena/users/ability.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/philomena/users/ability.ex b/lib/philomena/users/ability.ex index 5fd843c7..4a50bfba 100644 --- a/lib/philomena/users/ability.ex +++ b/lib/philomena/users/ability.ex @@ -82,8 +82,10 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do # Edit posts and comments def can?(%User{role: "moderator"}, :edit, %Post{}), do: true def can?(%User{role: "moderator"}, :hide, %Post{}), do: true + def can?(%User{role: "moderator"}, :delete, %Post{}), do: true def can?(%User{role: "moderator"}, :edit, %Comment{}), do: true def can?(%User{role: "moderator"}, :hide, %Comment{}), do: true + def can?(%User{role: "moderator"}, :delete, %Comment{}), do: true # Show the DNP list def can?(%User{role: "moderator"}, _action, DnpEntry), do: true