eco-helpers 2.0.14 → 2.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +90 -2
  3. data/eco-helpers.gemspec +6 -4
  4. data/lib/eco-helpers.rb +2 -0
  5. data/lib/eco/api/common/base_loader.rb +14 -0
  6. data/lib/eco/api/common/people/default_parsers/date_parser.rb +11 -1
  7. data/lib/eco/api/common/people/default_parsers/login_providers_parser.rb +1 -1
  8. data/lib/eco/api/common/people/default_parsers/policy_groups_parser.rb +11 -11
  9. data/lib/eco/api/common/people/entry_factory.rb +26 -9
  10. data/lib/eco/api/common/people/person_entry.rb +5 -2
  11. data/lib/eco/api/common/people/supervisor_helpers.rb +27 -0
  12. data/lib/eco/api/common/session.rb +1 -0
  13. data/lib/eco/api/common/session/base_session.rb +2 -0
  14. data/lib/eco/api/common/session/file_manager.rb +2 -2
  15. data/lib/eco/api/common/session/helpers.rb +30 -0
  16. data/lib/eco/api/common/session/helpers/prompt_user.rb +34 -0
  17. data/lib/eco/api/common/session/mailer.rb +0 -1
  18. data/lib/eco/api/common/session/s3_uploader.rb +0 -1
  19. data/lib/eco/api/common/session/sftp.rb +0 -1
  20. data/lib/eco/api/common/version_patches/ecoportal_api/external_person.rb +1 -1
  21. data/lib/eco/api/common/version_patches/ecoportal_api/internal_person.rb +7 -4
  22. data/lib/eco/api/common/version_patches/exception.rb +8 -4
  23. data/lib/eco/api/microcases.rb +3 -1
  24. data/lib/eco/api/microcases/append_usergroups.rb +0 -1
  25. data/lib/eco/api/microcases/people_cache.rb +2 -2
  26. data/lib/eco/api/microcases/people_load.rb +2 -2
  27. data/lib/eco/api/microcases/people_refresh.rb +2 -2
  28. data/lib/eco/api/microcases/people_search.rb +6 -6
  29. data/lib/eco/api/microcases/preserve_default_tag.rb +23 -0
  30. data/lib/eco/api/microcases/preserve_filter_tags.rb +28 -0
  31. data/lib/eco/api/microcases/preserve_policy_groups.rb +30 -0
  32. data/lib/eco/api/microcases/set_account.rb +0 -1
  33. data/lib/eco/api/microcases/with_each.rb +67 -6
  34. data/lib/eco/api/microcases/with_each_present.rb +4 -2
  35. data/lib/eco/api/microcases/with_each_starter.rb +4 -2
  36. data/lib/eco/api/organization.rb +1 -0
  37. data/lib/eco/api/organization/people.rb +98 -22
  38. data/lib/eco/api/organization/people_similarity.rb +112 -0
  39. data/lib/eco/api/organization/person_schemas.rb +5 -1
  40. data/lib/eco/api/organization/policy_groups.rb +5 -1
  41. data/lib/eco/api/organization/presets_factory.rb +40 -80
  42. data/lib/eco/api/organization/presets_integrity.json +6 -0
  43. data/lib/eco/api/organization/presets_values.json +5 -4
  44. data/lib/eco/api/policies/default_policies/99_user_access_policy.rb +0 -30
  45. data/lib/eco/api/session.rb +6 -22
  46. data/lib/eco/api/session/batch.rb +25 -7
  47. data/lib/eco/api/session/config.rb +16 -15
  48. data/lib/eco/api/session/config/api.rb +4 -0
  49. data/lib/eco/api/session/config/apis.rb +80 -0
  50. data/lib/eco/api/session/config/files.rb +7 -0
  51. data/lib/eco/api/session/config/people.rb +3 -19
  52. data/lib/eco/api/usecases/default_cases.rb +4 -1
  53. data/lib/eco/api/usecases/default_cases/abstract_policygroup_abilities_case.rb +161 -0
  54. data/lib/eco/api/usecases/default_cases/analyse_people_case.rb +53 -0
  55. data/lib/eco/api/usecases/default_cases/codes_to_tags_case.rb +2 -3
  56. data/lib/eco/api/usecases/default_cases/reset_landing_page_case.rb +11 -1
  57. data/lib/eco/api/usecases/default_cases/restore_db_case.rb +1 -2
  58. data/lib/eco/api/usecases/default_cases/supers_cyclic_identify_case.rb +72 -0
  59. data/lib/eco/api/usecases/default_cases/supers_hierarchy_case.rb +59 -0
  60. data/lib/eco/api/usecases/default_cases/to_csv_case.rb +132 -29
  61. data/lib/eco/api/usecases/default_cases/to_csv_detailed_case.rb +61 -36
  62. data/lib/eco/api/usecases/ooze_samples/ooze_update_case.rb +3 -2
  63. data/lib/eco/cli.rb +0 -10
  64. data/lib/eco/cli/config/default/options.rb +20 -17
  65. data/lib/eco/cli/config/default/people_filters.rb +3 -3
  66. data/lib/eco/cli/config/default/usecases.rb +80 -26
  67. data/lib/eco/cli/config/default/workflow.rb +16 -4
  68. data/lib/eco/cli/config/help.rb +1 -0
  69. data/lib/eco/cli/config/options_set.rb +106 -13
  70. data/lib/eco/cli/config/use_cases.rb +33 -33
  71. data/lib/eco/cli/scripting/args_helpers.rb +30 -3
  72. data/lib/eco/csv.rb +4 -2
  73. data/lib/eco/data.rb +1 -0
  74. data/lib/eco/data/crypto/encryption.rb +3 -3
  75. data/lib/eco/data/files/directory.rb +28 -20
  76. data/lib/eco/data/files/helpers.rb +6 -4
  77. data/lib/eco/data/fuzzy_match.rb +161 -0
  78. data/lib/eco/data/fuzzy_match/array_helpers.rb +75 -0
  79. data/lib/eco/data/fuzzy_match/chars_position_score.rb +37 -0
  80. data/lib/eco/data/fuzzy_match/ngrams_score.rb +78 -0
  81. data/lib/eco/data/fuzzy_match/pairing.rb +101 -0
  82. data/lib/eco/data/fuzzy_match/result.rb +73 -0
  83. data/lib/eco/data/fuzzy_match/results.rb +59 -0
  84. data/lib/eco/data/fuzzy_match/score.rb +44 -0
  85. data/lib/eco/data/fuzzy_match/stop_words.rb +35 -0
  86. data/lib/eco/data/fuzzy_match/string_helpers.rb +69 -0
  87. data/lib/eco/version.rb +1 -1
  88. metadata +87 -10
  89. data/lib/eco/api/microcases/refresh_abilities.rb +0 -19
  90. data/lib/eco/api/organization/presets_reference.json +0 -59
  91. data/lib/eco/api/usecases/default_cases/refresh_abilities_case.rb +0 -30
@@ -16,10 +16,9 @@ class Eco::API::UseCases::DefaultCases::CodesToTagsCase < Eco::API::Common::Load
16
16
  end
17
17
 
18
18
  def main(session, options, usecase)
19
- @session = session
20
- @options = options
19
+ options[:end_get] = false
20
+ @session = session; @options = options
21
21
  codes_to_tags
22
- exit
23
22
  end
24
23
 
25
24
  private
@@ -2,13 +2,23 @@ class Eco::API::UseCases::DefaultCases::ResetLandingPageCase < Eco::API::Common:
2
2
  name "reset-landing-page"
3
3
  type :transform
4
4
 
5
+ attr_reader :session, :options
6
+
5
7
  def main(people, session, options, usecase)
8
+ @session = session; @options = options
6
9
  update = session.new_job("main", "update", :update, usecase, :core)
7
10
 
8
11
  people.users.each do |user|
9
- user.account.landing_page_id = nil
12
+ user.account.landing_page_id = page_id
10
13
  update.add(user)
11
14
  end
12
15
  end
13
16
 
17
+ private
18
+
19
+ def page_id
20
+ options[:page_id]
21
+ end
22
+
23
+
14
24
  end
@@ -59,7 +59,6 @@ class Eco::API::UseCases::DefaultCases::RestoreDBCase < Eco::API::Common::Loader
59
59
  dst.policy_group_ids = src.policy_group_ids unless options.dig(:exclude, :policy_groups)
60
60
 
61
61
  unless options.dig(:exclude, :abilities)
62
- dst.permissions_preset = src.permissions_preset
63
62
  dst.permissions_custom = src.permissions_custom
64
63
  end
65
64
 
@@ -75,7 +74,7 @@ class Eco::API::UseCases::DefaultCases::RestoreDBCase < Eco::API::Common::Loader
75
74
  dst.starred_ids = src.starred_ids
76
75
  dst.landing_page_id = src.landing_page_id
77
76
  end
78
-
77
+
79
78
  dst&.send_invites = options[:send_invites] if options.key?(:send_invites)
80
79
  end
81
80
  end
@@ -0,0 +1,72 @@
1
+ class Eco::API::UseCases::DefaultCases::SupersCyclicIdentify < Eco::API::Common::Loaders::UseCase
2
+ name "identify-cyclic-supers"
3
+ type :export
4
+
5
+ attr_reader :session, :people, :options
6
+
7
+ def main(people, session, options, usecase)
8
+ options[:end_get] = false
9
+ @session = session; @options = options; @people = people
10
+
11
+ save!(cyclic_sets)
12
+ end
13
+
14
+ private
15
+
16
+ def cyclic_sets
17
+ Eco::API::Common::People::SupervisorHelpers.identify_cyclic_chains(people)
18
+ end
19
+
20
+ def file
21
+ @file ||= options.dig(:output, :file) || "cyclic_supers.txt"
22
+ end
23
+
24
+ def save!(data)
25
+ if data.empty?
26
+ session.logger.info("There were no cyclic supervisors identified!!")
27
+ return
28
+ end
29
+
30
+ ext = File.extname(file).downcase.delete(".")
31
+
32
+ File.open(file, "w") do |fd|
33
+ if ext == "txt"
34
+ create_file(data, file: file, format: :txt)
35
+ elsif ext == "html"
36
+ puts "html is still not supported"
37
+ exit(1)
38
+ create_file(data, file: file, format: :html)
39
+ elsif ext == "json"
40
+ puts "json is still not supported"
41
+ exit(1)
42
+ create_file(data, file: file, format: :json)
43
+ end
44
+ end
45
+ end
46
+
47
+ def create_file(sets, file:, format: :txt)
48
+ File.open(file, "w") do |fd|
49
+ fd << sets_to_str(sets, format: format)
50
+ end
51
+ puts "Generated file #{file}"
52
+ end
53
+
54
+ def sets_to_str(sets, format: :txt)
55
+ raise "Required Array. Given: #{sets.class}" unless sets.is_a?(Array)
56
+ "".tap do |str|
57
+ sets.each do |set|
58
+ str << set_to_str(set, format: format)
59
+ end
60
+ end
61
+ end
62
+
63
+ def set_to_str(set, lev: 0, format: :txt)
64
+ raise "Required Array. Given: #{set.class}" unless set.is_a?(Array)
65
+ "".tap do |str|
66
+ entry = set.shift
67
+ str << "#{" " * lev}#{(lev > 0)? "+-#{lev}- " : ""}#{entry.name} (#{entry.external_id}|#{entry.email}|#{entry.id})\n"
68
+ str << set_to_str(set, lev: lev + 1, format: format) unless !set || set.empty?
69
+ end
70
+ end
71
+
72
+ end
@@ -0,0 +1,59 @@
1
+ class Eco::API::UseCases::DefaultCases::SupersHierarchy < Eco::API::Common::Loaders::UseCase
2
+ name "supers-hierarchy"
3
+ type :export
4
+
5
+ attr_reader :session, :people, :options
6
+
7
+ def main(people, session, options, usecase)
8
+ options[:end_get] = false
9
+ @session = session; @options = options; @people = people
10
+
11
+ save!(hierarchy)
12
+ end
13
+
14
+ private
15
+
16
+ def hierarchy
17
+ Eco::API::Common::People::SupervisorHelpers.supervisors_tree(people)
18
+ end
19
+
20
+ def file
21
+ @file ||= options.dig(:output, :file) || "supers_hierarchy.txt"
22
+ end
23
+
24
+ def save!(data)
25
+ ext = File.extname(file).downcase.delete(".")
26
+
27
+ File.open(file, "w") do |fd|
28
+ if ext == "txt"
29
+ create_file(data, file: file, format: :txt)
30
+ elsif ext == "html"
31
+ puts "html is still not supported"
32
+ exit(1)
33
+ create_file(data, file: file, format: :html)
34
+ elsif ext == "json"
35
+ puts "json is still not supported"
36
+ exit(1)
37
+ create_file(data, file: file, format: :json)
38
+ end
39
+ end
40
+ end
41
+
42
+ def create_file(tree, file:, format: :txt)
43
+ File.open(file, "w") do |fd|
44
+ fd << tree_to_str(tree, format: format)
45
+ end
46
+ puts "Generated file #{file}"
47
+ end
48
+
49
+ def tree_to_str(tree, lev: 0, format: :txt)
50
+ raise "Required Hash tree structure. Given: #{tree.class}" unless tree.is_a?(Hash)
51
+ "".tap do |str|
52
+ tree.each do |entry, subtree|
53
+ str << "#{" " * lev}#{(lev > 0)? "+-#{lev}- " : ""}#{entry.name} (#{entry.external_id}|#{entry.email}|#{entry.id})\n"
54
+ str << tree_to_str(subtree, lev: lev + 1, format: format) unless !subtree || subtree.empty?
55
+ end
56
+ end
57
+ end
58
+
59
+ end
@@ -5,6 +5,7 @@ class Eco::API::UseCases::DefaultCases::ToCsvCase < Eco::API::Common::Loaders::U
5
5
  attr_reader :session, :options, :people
6
6
 
7
7
  def main(people, session, options, usecase)
8
+ options[:end_get] = false
8
9
  @session = session; @options = options; @people = people
9
10
 
10
11
  unless people && !people.empty?
@@ -12,25 +13,62 @@ class Eco::API::UseCases::DefaultCases::ToCsvCase < Eco::API::Common::Loaders::U
12
13
  return false
13
14
  end
14
15
 
15
- unless file = options[:file] || options.dig(:export, :file, :name)
16
- session.logger.error("Destination file not specified")
17
- return false
16
+ if options.dig(:export, :options, :split_schemas)
17
+ by_schema.each do |id, people|
18
+ sch_name = schemas.to_name(id)
19
+ prefix = sch_name ? sch_name.gsub(" ", "_") : "No_Schema"
20
+ create_file!("#{prefix}_#{file}", people)
21
+ end
22
+ else
23
+ create_file!(file, people)
18
24
  end
25
+ end
26
+
27
+ private
19
28
 
20
- session.logger.info("going to create file: #{file}")
29
+ def create_file!(filename = file, data = people)
30
+ session.logger.info("going to create file: #{filename}")
21
31
 
22
- CSV.open(file, "w") do |csv|
23
- csv << spot_header
24
- people.each do |person|
25
- csv << target_entry_type(person).values
32
+ CSV.open(filename, "w") do |csv|
33
+ csv << spot_header(data.first)
34
+ data.each do |person|
35
+ csv << to_row(person)
26
36
  end
27
37
  end
28
- exit(0)
29
38
  end
30
39
 
31
- private
40
+ def to_row(person)
41
+ entry = to_entry_type(person)
42
+ entry.values_at(*keys(entry)).tap do |row|
43
+ row << schemas.to_name(person.details&.schema_id) || "No Schema"
44
+ end
45
+ end
46
+
47
+ def spot_header(person = people.first)
48
+ header = keys(to_entry_type(person))
49
+ header << "Schema"
50
+ header = yield(header) if block_given?
51
+ header = nice_header_names(header, schema: schema(person.details)) if nice_header_names?
52
+ header
53
+ end
54
+
55
+ def keys(entry)
56
+ entry.keys - ["freemium", "send_invites"]
57
+ end
58
+
59
+ def nice_header_names?
60
+ options.dig(:nice_header) || options.dig(:export, :options, :nice_header)
61
+ end
32
62
 
33
- def target_entry_type(person)
63
+ def nice_header_names(header, schema: nil)
64
+ schema ||= session.schema
65
+ name_maps = schema.fields_by_alt_id.each_with_object({}) do |(alt_id, fld), mappings|
66
+ mappings[alt_id] = fld.name
67
+ end.merge(nice_header_maps)
68
+ header.map {|name| name_maps[name] ? name_maps[name] : name}
69
+ end
70
+
71
+ def to_entry_type(person)
34
72
  session.new_entry(person, dependencies: deps).yield_self do |person_entry|
35
73
  options.dig(:export, :options, :internal_names) ? person_entry.mapped_entry : person_entry.external_entry
36
74
  end
@@ -40,26 +78,91 @@ class Eco::API::UseCases::DefaultCases::ToCsvCase < Eco::API::Common::Loaders::U
40
78
  @deps ||= {"supervisor_id" => {people: people}}
41
79
  end
42
80
 
43
- def spot_header
44
- entry = target_entry_type(people.first)
45
- header = entry.keys
46
-
47
- if options.dig(:nice_header) || options.dig(:export, :options, :nice_header)
48
- name_maps = session.schema.fields_by_alt_id.transform_values do |fld|
49
- fld.name
50
- end.merge({
51
- "policy_group_ids" => "User Group(s)",
52
- "email" => "Email",
53
- "name" => "Name",
54
- "supervisor_id" => "Manager ID",
55
- "filter_tags" => "Locations",
56
- "default_tag" => "Default Location",
57
- "id" => "ecoPortal ID"
58
- })
59
- header = header.map {|name| name_maps[name] ? name_maps[name] : name}
81
+ def file
82
+ @file ||= (options[:file] || options.dig(:export, :file, :name)).tap do |filename|
83
+ unless filename
84
+ session.logger.error("Destination file not specified")
85
+ return false
86
+ end
87
+ end
88
+ end
89
+
90
+ def by_schema
91
+ people.group_by do |person|
92
+ if details = person.details
93
+ details.schema_id
94
+ end
95
+ end.transform_values do |persons|
96
+ people.newFrom persons
97
+ end
98
+ end
99
+
100
+ def schema(value)
101
+ case value
102
+ when Ecoportal::API::V1::Person
103
+ schema(value.details&.schema_id)
104
+ when String
105
+ schemas[value]
106
+ when Ecoportal::API::V1::PersonDetails
107
+ schema(value.schema_id)
108
+ when Ecoportal::API::V1::PersonSchema
109
+ value
60
110
  end
61
- header
62
111
  end
63
112
 
113
+ def schemas
114
+ session.schemas
115
+ end
116
+
117
+ def nice_header_maps
118
+ @nice_header_maps ||= {
119
+ "policy_group_ids" => "User Group(s)",
120
+ "email" => "Email",
121
+ "name" => "Name",
122
+ "supervisor_id" => "Manager ID",
123
+ "filter_tags" => "Locations",
124
+ "default_tag" => "Default Location",
125
+ "id" => "ecoPortal ID",
126
+ "external_id" => "Reference ID (ext_id)",
127
+ "login_provider_ids" => "Login Methods",
128
+ "landing_page_id" => "Landing Page ID",
129
+ "show_sidebar" => "(pref) Sidebar Open?",
130
+ "show_shortcuts" => "(pref) Link to Registers?",
131
+ "show_coming_soon" => "(pref) Coming Soon List?",
132
+ "show_recently_visited_forms" => "(pref) Recently Visited Forms List?",
133
+ "show_tasks" => "(pref) Tasks List?",
134
+ "show_task_bubbles" => "(pref) Task Count Bubbles",
135
+ "kiosk_enabled" => "Kiosk User?",
136
+ "freemium" => "Freemium User?",
137
+ "files" => "(able) on Files",
138
+ "reports" => "(able) on Report Structures",
139
+ "data" => "(able) on Data (hours, datasets)",
140
+ "organization" => "(able) on Organization Config",
141
+ "pages" => "(able) on Page/Entries",
142
+ "page_editor" => "(able) page Editor Level",
143
+ "registers" => "(able) on Registers",
144
+ "tasks" => "(able) on Tasks",
145
+ "person_core" => "(able) on People",
146
+ "person_core_create" => "(able) Create People?",
147
+ "person_core_edit" => "(able) Edit People?",
148
+ "person_details" => "(able) on People Schema Details",
149
+ "person_account" => "(able) on Users",
150
+ "person_abilities" => "(able) on Users' Abilities",
151
+ "custom_files" => "(min) on Files",
152
+ "custom_reports" => "(min) on Report Structures",
153
+ "custom_data" => "(min) on Data (hours, datasets)",
154
+ "custom_organization" => "(min) on Organization Config",
155
+ "custom_pages" => "(min) on Page/Entries",
156
+ "custom_page_editor" => "(min) page Editor Level",
157
+ "custom_registers" => "(min) on Registers",
158
+ "custom_tasks" => "(min) on Tasks",
159
+ "custom_person_core" => "(min) on People",
160
+ "custom_person_core_create" => "(min) Create People?",
161
+ "custom_person_core_edit" => "(min) Edit People?",
162
+ "custom_person_details" => "(min) on People Schema Details",
163
+ "custom_person_account" => "(min) on Users",
164
+ "custom_person_abilities" => "(min) on Users' Abilities"
165
+ }
166
+ end
64
167
 
65
168
  end
@@ -1,53 +1,78 @@
1
- class Eco::API::UseCases::DefaultCases::ToCsvDetailedCase < Eco::API::Common::Loaders::UseCase
1
+ class Eco::API::UseCases::DefaultCases::ToCsvDetailedCase < Eco::API::UseCases::DefaultCases::ToCsvCase
2
2
  name "to-csv-detailed"
3
3
  type :export
4
4
 
5
- def main(people, session, options, usecase)
6
- unless people && !people.empty?
7
- session.logger.warn("No source people to create the file... aborting!")
8
- return false
9
- end
5
+ private
6
+
7
+ def to_row(person)
8
+ data = super(person)
9
+ data << person.subordinates
10
+ data << person_supervisor(person)
11
+ data += user_abilities(person)
12
+ data += user_permissions_custom(person) if options.dig(:export, :options, :permissions_custom)
13
+ account = person.account
14
+ data << account&.landing_page_id
15
+ data += user_preferences(person)
16
+ data
17
+ end
10
18
 
11
- unless file = options[:file] || options.dig(:export, :file, :name)
12
- session.logger.error("Destination file not specified")
13
- return false
19
+ def person_supervisor(person)
20
+ session.micro.with_supervisor(person.supervisor_id, people) do |supervisor|
21
+ return supervisor ? supervisor.name : ""
14
22
  end
23
+ end
15
24
 
16
- login_providers = session.login_providers
17
- abilities = session.presets_factory.keys
25
+ def user_abilities(person)
26
+ account_abilities = (person.account && person.account.permissions_merged) || {}
27
+ abilities.map {|key| account_abilities[key] || "no access"}
28
+ end
18
29
 
19
- session.logger.info("going to create file: #{file}")
20
- CSV.open(file, "w") do |csv|
21
- deps = {"supervisor_id" => {people: people}}
30
+ def user_permissions_custom(person)
31
+ account_abilities = (person.account && person.account.permissions_custom) || {}
32
+ abilities.map {|key| account_abilities[key] || "no access"}
33
+ end
22
34
 
23
- person_model = people.first
24
- person_entry = session.new_entry(person_model, dependencies: deps)
25
- header = person_entry.external_entry.keys
26
- header += ["Subordinates"]
27
- header += ["Supervisor Name"]
28
- header += abilities
29
- header += ["Landing Page"]
35
+ def user_preferences(person)
36
+ user_preferences = (person.account && person.account.preferences&.doc) || {}
37
+ preferences.map {|key| user_preferences[key] || false}
38
+ end
30
39
 
31
- csv << header
32
- people.each do |person|
33
- data = session.new_entry(person, dependencies: deps).external_entry.values
40
+ def spot_header(person = people.first)
41
+ super(person) do |header|
42
+ header << "Subordinates"
43
+ header << "Supervisor Name"
44
+ header += abilities_header
45
+ header += abilities_header("custom") if options.dig(:export, :options, :permissions_custom)
46
+ header << "Landing Page"
47
+ header += preferences
48
+ header
49
+ end
50
+ end
34
51
 
35
- data.push(person.subordinates)
36
- session.micro.with_supervisor(person.supervisor_id, people) do |supervisor|
37
- data.push supervisor ? supervisor.name : ""
38
- end
52
+ def keys(entry)
53
+ super(entry) + ["freemium"]
54
+ end
39
55
 
40
- person_abilities = (person.account && person.account.permissions_custom) || {}
41
- data += abilities.map {|key| person_abilities[key] || "no access"}
56
+ def login_providers
57
+ session.login_providers
58
+ end
42
59
 
43
- if person.account && landing_id = person.account.landing_page_id
44
- data.push(landing_id)
45
- end
60
+ def abilities
61
+ @abilities ||= session.presets_factory.keys
62
+ end
46
63
 
47
- csv << data
48
- end
64
+ def abilities_header(prefix = nil)
65
+ abilities.map do |key|
66
+ prefix ? "#{prefix}_#{key}" : key
49
67
  end
50
- exit(0)
68
+ end
69
+
70
+ def preferences
71
+ @preferences ||= [
72
+ "show_sidebar", "show_shortcuts", "show_coming_soon", "show_recently_visited_forms",
73
+ "show_tasks", "show_task_bubbles",
74
+ "kiosk_enabled"
75
+ ]
51
76
  end
52
77
 
53
78
  end