Last active
August 29, 2015 14:26
-
-
Save cpjk/bc4bcccda99dc1aa3161 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defimpl Canada.Can, for: User do | |
def can?(%User{}, :show, %Post), do: true | |
end | |
defimpl Canada.Can, for: User do # this overwrites the first implementation rather than extending it | |
def can?(%User{}, :delete, %Post), do: false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment