Skip to content

Instantly share code, notes, and snippets.

@cpjk
Created September 15, 2015 16:07
Show Gist options
  • Save cpjk/98f88ad068123f480037 to your computer and use it in GitHub Desktop.
Save cpjk/98f88ad068123f480037 to your computer and use it in GitHub Desktop.
require Abilities
defmodule User do
defstruct id: 1, dude_id: 1
end
defmodule M do
use Abilities
Abilities.can(%User{id: id}, :post, %User{}, when: id in [1,2])
Abilities.can(%User{id: id}, :post, %User{}, when: id in [1,2])
Abilities.can(%User{id: id}, :post, %User{}, when: id in [1,2])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment