porkchopclub/porkchop

View on GitHub
app/abilities/ability.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Ability
  include CanCan::Ability

  def initialize(player)
    player ||= Player.new

    can :update, Player, id: player.id

    if player.admin?
      can :manage, :all
    else
      can :read, :all
    end
  end
end