Guest User

Untitled

a guest
Jan 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. class ReaderRolePermit < CanTango::RolePermit
  2. def initialize ability
  3. super
  4. end
  5.  
  6. protected
  7.  
  8. def permit_rules
  9. can :read, Smodel do |instance|
  10. #raise "We are here because CanTango evaluates conditions inside blocks when we call #user_can? on instances (see foo/_partial.html.erb)"
  11. instance.id>2
  12. end
  13. end
  14. end
Add Comment
Please, Sign In to add comment