Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if user.role? :user
- can :read, :all
- can :create, :all
- can :destroy, :all do |all|
- all.each { |m|
- m.try(:user) == user
- }
- all.each { |m| 3.minutes.ago <= m.created_at }
- end
- can :update, :all do |all|
- all.each { |m|
- debugger
- m.try(:user) == user
- }
- 3.minutes.ago <= all.created_at
- end
- end
Add Comment
Please, Sign In to add comment