Module: AdGear::Infrastructure::GroupManager::Config
Overview
Constant Summary collapse
- GLOBAL_CONFIG =
The global config instance rubocop:disable Style/MutableConstant
{ data: { locations: {}, organizational: {}, functional: {}, permissions: {} } }
Constants included from Logging
Class Method Summary collapse
-
.list_all_groups ⇒ Object
Lists all the groups.
-
.list_func_groups ⇒ Object
List all funcitonal groups defined in local configuration.
-
.list_locations ⇒ Object
List all location groups defined in local configuration.
-
.list_org_groups ⇒ Object
List all organizational groups defined in local configuration.
-
.list_perm_groups ⇒ Object
List all organizational groups defined in local configuration.
-
.list_users ⇒ Object
List all users defined in local configuration.
Methods included from Logging
Class Method Details
.list_all_groups ⇒ Object
Lists all the groups
67 68 69 70 71 72 73 |
# File 'lib/config.rb', line 67 def list_all_groups newobj = {} GLOBAL_CONFIG[:data].each do |_k, v| newobj.merge!(v) end newobj end |
.list_func_groups ⇒ Object
List all funcitonal groups defined in local configuration
89 90 91 |
# File 'lib/config.rb', line 89 def list_func_groups GLOBAL_CONFIG[:data][:functional] end |
.list_locations ⇒ Object
List all location groups defined in local configuration.
95 96 97 |
# File 'lib/config.rb', line 95 def list_locations GLOBAL_CONFIG[:data][:locations] end |
.list_org_groups ⇒ Object
List all organizational groups defined in local configuration.
77 78 79 |
# File 'lib/config.rb', line 77 def list_org_groups GLOBAL_CONFIG[:data][:organizational] end |
.list_perm_groups ⇒ Object
List all organizational groups defined in local configuration.
83 84 85 |
# File 'lib/config.rb', line 83 def list_perm_groups GLOBAL_CONFIG[:data][:permissions] end |
.list_users ⇒ Object
List all users defined in local configuration.
101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/config.rb', line 101 def list_users users = [] list_all_groups.each do |_k, v| next if v.nil? next unless v.key?('member') next if v['member'].nil? users += v['member'] end users = users.uniq.sort - list_all_groups.keys end |