Sha256: 0752913cb388feb605d00039c664c3715fe11e7ba4da51975fa4efbdf60e91cd

Contents?: true

Size: 447 Bytes

Versions: 3

Compression:

Stored size: 447 Bytes

Contents

module TheCoreAbilities
  def core_abilities(user)
    # Normal core abilities file
    if user
      can :access, :rails_admin # grant access to rails_admin
      can :dashboard, :all # allow access to dashboard
      if user.admin?
        can :manage, :all # only allow admin users to access Rails Admin
        cannot :destroy, User do |u|
          # prevents killing himself
          u.id == user.id
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
thecore-1.7.7 lib/abilities.rb
thecore-1.7.5 lib/abilities.rb
thecore-1.7.3 lib/abilities.rb