Sha256: caed9bdf5a04fcd16aad7820334f63ccc951ffb527290e94dfd8dc7652b0c6fa

Contents?: true

Size: 289 Bytes

Versions: 8

Compression:

Stored size: 289 Bytes

Contents

class Ability
  include CanCan::Ability

  def initialize(user)
    user ||= User.new # guest user (not logged in)
    if user.has_role? :admin
      can :manage, :all
    else
      can :read, :all
      # can :read, Page do |page|
      #   page.published?
      # end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rails-replicator-0.1.7 templates/ability.rb
rails-replicator-0.1.6 templates/ability.rb
rails-replicator-0.1.5 templates/ability.rb
rails-replicator-0.1.4 templates/ability.rb
rails-replicator-0.1.3 templates/ability.rb
rails-replicator-0.1.2 templates/ability.rb
rails-replicator-0.1.1 templates/ability.rb
rails-replicator-0.1.0 templates/ability.rb