Sha256: 2ef481766a2e92cd0a7b0174b1eee64b541011e4ff2f9c5c4107b1ef8def0360
Contents?: true
Size: 531 Bytes
Versions: 22
Compression:
Stored size: 531 Bytes
Contents
class GuestRolePermit < CanTango::RolePermit def initialize ability super end protected def static_rules can :read, [Comment, Post, Article] can :create, Article # licenses :user_admin, :blogging # Guest must have an id #owns(user, Comment) # a user can manage comments he/she created # can :manage, Comment do |comment| # (comment.try(:user) == current_user) || (comment.try(:author) == current_user) # end # can :create, Comment end end
Version data entries
22 entries across 22 versions & 1 rubygems