Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ReaderRolePermit < CanTango::RolePermit
- def initialize ability
- super
- end
- protected
- def permit_rules
- can :read, Smodel do |instance|
- #raise "We are here because CanTango evaluates conditions inside blocks when we call #user_can? on instances (see foo/_partial.html.erb)"
- instance.id>2
- end
- end
- end
Add Comment
Please, Sign In to add comment