Sha256: ec059cd92e8bd5139b870e933f1c7df539b9f37db10952a207417f2b414c43c6
Contents?: true
Size: 799 Bytes
Versions: 65
Compression:
Stored size: 799 Bytes
Contents
class Eco::API::Common::People::DefaultParsers::PolicyGroupsParser < Eco::API::Common::Loaders::Parser attribute "policy_group_ids" parsing_phase :final def parser(hash, deps) policy_group_ids = hash["policy_group_ids"] || [] policy_group_ids.map do |name| policy_groups.to_id(name&.downcase.strip) end.compact.tap do |pg_names| pg_names.push(default_id) if pg_names.empty? end end def serializer(person, deps) ids = person&.account&.policy_group_ids || [] ids.map do |id| policy_groups.to_name(id) end.compact end private def default_id @default_id ||= policy_groups.to_id(config.people.default_usergroup) end def policy_groups @policy_groups ||= config.policy_groups end end
Version data entries
65 entries across 65 versions & 1 rubygems