module Bits
  class UserPolicy < ApplicationPolicy
    def index?
      allowed?
    end

    def show?
      allowed?
    end

    def add_bits?
      allowed?
    end

    def add_bits_for_campaign?
      allowed?
    end

    def remove_bits?
      allowed?
    end

    def set_ban_status?
      allowed?
    end

    def set_opt_out_status?
      allowed?
    end

    def moderate_cheermote?
      allowed?
    end

    def download_cheermotes?
      allowed?
    end

    def allowed?
      user.permitted? BeefCake::Permission.for(:user_bits)
    end
  end
end
