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

Version Path
cantango-0.9.4.7 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.9.4.6 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.9.4.5 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.9.4.3 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.9.4.2 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.9.4.1 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.9.4 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.9.3.2 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.8.9.5 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.8.9.4 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.8.9.3 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.8.9.2 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.8.9.1 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.8.9 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.8.8.1 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.8.8 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.8.7 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.8.6.2 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.8.6.1 spec/active_record/scenarios/shared/permits/role/guest_permit.rb
cantango-0.8.6 spec/active_record/scenarios/shared/permits/role/guest_permit.rb