Sha256: 463689f409eb34571907de14c777fa5b59d9cf2aab6ba90779d53e3c32beb2e4
Contents?: true
Size: 495 Bytes
Versions: 19
Compression:
Stored size: 495 Bytes
Contents
class GuestPermit < Permit::Base def initialize(ability, options = {}) super end def permit?(user, options = {}) super return if !role_match? user can :read, [Comment, Post] can :create, Article # licenses :user_admin, :blogging owns(user, Comment) # a user can manage comments he/she created # can :manage, Comment do |comment| # comment.try(:user) == user # end # can :create, Comment end end
Version data entries
19 entries across 19 versions & 1 rubygems