# File lib/permits.rb, line 46 def permit?(user) super return if user.role? :admin can :read, :all # user.owns(Comment) # a user can manage comments he/she created # can :manage, Comment do |comment| # comment.try(:user) == user # end # can :create, Comment end
# File lib/permits.rb, line 42 def initialize(ability) super end