def primary_domain_type
      return nil if roles.empty?
      domain_types = roles.collect(&:domain_type)
      ranked_domain_types = roles.first.class::DOMAIN_TYPES
      ranked_domain_types.each do |ranked_domain_type|
        return ranked_domain_type if domain_types.include?(ranked_domain_type)
      end
      nil # unrecognized domain_type value(s)
    end
def primary_domain_type
      return nil if roles.empty?
      domain_types = roles.collect(&:domain_type)
      ranked_domain_types = roles.first.class::DOMAIN_TYPES
      ranked_domain_types.each do |ranked_domain_type|
        return ranked_domain_type if domain_types.include?(ranked_domain_type)
      end
      nil # unrecognized domain_type value(s)
    end
inclusion of this module necessitates that the app's roles implementation includes:
 1. domain_type field
 2. define DOMAIN_TYPES as a ranked list of strings in implementation of Role/Permissify::Model-including class
 NOTE: in example app, helper methods enforce only assigning domain_type-specific roles to users
       (an brand user can only be asigned roles that have a domain type of Brand).