more permissions

This commit is contained in:
byte[] 2019-12-14 16:26:05 -05:00
parent 993658ce0e
commit 7a1cc312f3

View file

@ -64,6 +64,11 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do
# Reveal anon users
def can?(%User{role: "moderator"}, :reveal_anon, _object), do: true
def can?(%User{role: "moderator"}, :show, :ip_address), do: true
# Edit posts and comments
def can?(%User{role: "moderator"}, :edit, %Post{}), do: true
def can?(%User{role: "moderator"}, :edit, %Comment{}), do: true
# Show the DNP list
def can?(%User{role: "moderator"}, :index, DnpEntry), do: true