class CanisterPolicy
  attr_reader :current_user, :model

  def initialize(current_user, model)
    @current_user = current_user || User.new
    @model = model
  end

  def index?
    @current_user.admin? || true
  end

  def show?
    @current_user.admin? || @current_user == @model.user
  end

  def create?
    @current_user.admin? || true
  end

  def new?
    @current_user.present?
  end

  def edit?
    @current_user.admin? || @current_user == @model.user
  end

  def update?
    @current_user.admin? || @current_user == @model.user
  end

  def destroy?
    @current_user.admin? || @current_user == @model.user
  end

end
