From f0ccdea54cd9f45f3bb24a5ee2e6692cedcc0e72 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sat, 5 Sep 2020 23:04:04 -0400 Subject: [PATCH] allow moderators to add new streams --- lib/philomena/users/ability.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/philomena/users/ability.ex b/lib/philomena/users/ability.ex index 2fdb17f3..741b0c52 100644 --- a/lib/philomena/users/ability.ex +++ b/lib/philomena/users/ability.ex @@ -49,6 +49,10 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do def can?(%User{role: "moderator"}, _action, Image), do: true def can?(%User{role: "moderator"}, _action, %Image{}), do: true + # Manage channels + def can?(%User{role: "moderator"}, _action, Channel), do: true + def can?(%User{role: "moderator"}, _action, %Channel{}), do: true + # View comments def can?(%User{role: "moderator"}, :show, %Comment{}), do: true