mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
filter editing
This commit is contained in:
parent
2df262a1de
commit
dae9f90501
1 changed files with 3 additions and 0 deletions
|
@ -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],
|
||||
|
|
Loading…
Reference in a new issue