From dae9f9050177bc7c043a823266801780bafe20a6 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sat, 30 Nov 2019 21:25:42 -0500 Subject: [PATCH] filter editing --- lib/philomena/users/ability.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/philomena/users/ability.ex b/lib/philomena/users/ability.ex index 579b584d..f647b319 100644 --- a/lib/philomena/users/ability.ex +++ b/lib/philomena/users/ability.ex @@ -56,6 +56,9 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do def can?(_user, :show, %Filter{system: true}), do: true def can?(%User{id: id}, :show, %Filter{user_id: id}), do: true + # Edit filters they own + def can?(%User{id: id}, action, %Filter{user_id: id}) when action in [:edit, :update], do: true + # View non-deleted images def can?(_user, action, Image) when action in [:new, :create, :index],