forest_liana 5.3.0 → 5.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/forest_liana/actions_controller.rb +28 -5
  3. data/app/controllers/forest_liana/resources_controller.rb +14 -17
  4. data/app/controllers/forest_liana/smart_actions_controller.rb +10 -5
  5. data/app/helpers/forest_liana/widgets_helper.rb +59 -0
  6. data/app/services/forest_liana/permissions_checker.rb +118 -56
  7. data/app/services/forest_liana/permissions_formatter.rb +52 -0
  8. data/app/services/forest_liana/permissions_getter.rb +52 -17
  9. data/app/services/forest_liana/scope_validator.rb +8 -7
  10. data/app/services/forest_liana/utils/beta_schema_utils.rb +13 -0
  11. data/lib/forest_liana/version.rb +1 -1
  12. data/spec/dummy/app/assets/config/manifest.js +1 -0
  13. data/spec/dummy/config/application.rb +1 -1
  14. data/spec/dummy/db/migrate/20190226172951_create_user.rb +1 -1
  15. data/spec/dummy/db/migrate/20190226173051_create_isle.rb +1 -1
  16. data/spec/dummy/db/migrate/20190226174951_create_tree.rb +1 -1
  17. data/spec/dummy/db/migrate/20190716130830_add_age_to_tree.rb +1 -1
  18. data/spec/dummy/db/migrate/20190716135241_add_type_to_user.rb +1 -1
  19. data/spec/dummy/db/schema.rb +18 -20
  20. data/spec/requests/actions_controller_spec.rb +98 -12
  21. data/spec/requests/resources_spec.rb +4 -4
  22. data/spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb +711 -0
  23. data/spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb +831 -0
  24. data/spec/services/forest_liana/permissions_formatter_spec.rb +222 -0
  25. data/spec/services/forest_liana/permissions_getter_spec.rb +82 -0
  26. data/spec/spec_helper.rb +3 -0
  27. data/test/dummy/app/assets/config/manifest.js +1 -0
  28. data/test/dummy/config/application.rb +1 -1
  29. data/test/dummy/db/migrate/20150608130516_create_date_field.rb +1 -1
  30. data/test/dummy/db/migrate/20150608131430_create_integer_field.rb +1 -1
  31. data/test/dummy/db/migrate/20150608131603_create_decimal_field.rb +1 -1
  32. data/test/dummy/db/migrate/20150608131610_create_float_field.rb +1 -1
  33. data/test/dummy/db/migrate/20150608132159_create_boolean_field.rb +1 -1
  34. data/test/dummy/db/migrate/20150608132621_create_string_field.rb +1 -1
  35. data/test/dummy/db/migrate/20150608133038_create_belongs_to_field.rb +1 -1
  36. data/test/dummy/db/migrate/20150608133044_create_has_one_field.rb +1 -1
  37. data/test/dummy/db/migrate/20150608150016_create_has_many_field.rb +1 -1
  38. data/test/dummy/db/migrate/20150609114636_create_belongs_to_class_name_field.rb +1 -1
  39. data/test/dummy/db/migrate/20150612112520_create_has_and_belongs_to_many_field.rb +1 -1
  40. data/test/dummy/db/migrate/20150616150629_create_polymorphic_field.rb +1 -1
  41. data/test/dummy/db/migrate/20150623115554_create_has_many_class_name_field.rb +1 -1
  42. data/test/dummy/db/migrate/20150814081918_create_has_many_through_field.rb +1 -1
  43. data/test/dummy/db/migrate/20160627172810_create_owner.rb +1 -1
  44. data/test/dummy/db/migrate/20160627172951_create_tree.rb +1 -1
  45. data/test/dummy/db/migrate/20160628173505_add_timestamps.rb +1 -1
  46. data/test/dummy/db/migrate/20170614141921_create_serialize_field.rb +1 -1
  47. data/test/dummy/db/migrate/20181111162121_create_references_table.rb +1 -1
  48. data/test/services/forest_liana/resources_getter_test.rb +1 -1
  49. metadata +17 -2
@@ -1,4 +1,4 @@
1
- class CreateReferencesTable < ActiveRecord::Migration
1
+ class CreateReferencesTable < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :references do |t|
4
4
  end
@@ -106,7 +106,7 @@ module ForestLiana
106
106
  conditions: [{
107
107
  field: 'created_at',
108
108
  operator: 'after',
109
- value: '2015-06-18 08:00:00',
109
+ value: "#{Time.now.year - 5}-06-18 08:00:00",
110
110
  }, {
111
111
  field: 'owner:name',
112
112
  operator: 'equal',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-07 00:00:00.000000000 Z
11
+ date: 2021-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -214,6 +214,7 @@ files:
214
214
  - app/helpers/forest_liana/is_same_data_structure_helper.rb
215
215
  - app/helpers/forest_liana/query_helper.rb
216
216
  - app/helpers/forest_liana/schema_helper.rb
217
+ - app/helpers/forest_liana/widgets_helper.rb
217
218
  - app/models/forest_liana/model/action.rb
218
219
  - app/models/forest_liana/model/collection.rb
219
220
  - app/models/forest_liana/model/segment.rb
@@ -254,6 +255,7 @@ files:
254
255
  - app/services/forest_liana/objective_stat_getter.rb
255
256
  - app/services/forest_liana/operator_date_interval_parser.rb
256
257
  - app/services/forest_liana/permissions_checker.rb
258
+ - app/services/forest_liana/permissions_formatter.rb
257
259
  - app/services/forest_liana/permissions_getter.rb
258
260
  - app/services/forest_liana/pie_stat_getter.rb
259
261
  - app/services/forest_liana/query_stat_getter.rb
@@ -278,6 +280,7 @@ files:
278
280
  - app/services/forest_liana/stripe_subscriptions_getter.rb
279
281
  - app/services/forest_liana/two_factor_registration_confirmer.rb
280
282
  - app/services/forest_liana/user_secret_creator.rb
283
+ - app/services/forest_liana/utils/beta_schema_utils.rb
281
284
  - app/services/forest_liana/value_stat_getter.rb
282
285
  - app/views/layouts/forest_liana/application.html.erb
283
286
  - config/initializers/arel-helpers.rb
@@ -299,6 +302,7 @@ files:
299
302
  - lib/tasks/send_apimap.rake
300
303
  - spec/dummy/README.rdoc
301
304
  - spec/dummy/Rakefile
305
+ - spec/dummy/app/assets/config/manifest.js
302
306
  - spec/dummy/app/assets/javascripts/application.js
303
307
  - spec/dummy/app/assets/stylesheets/application.css
304
308
  - spec/dummy/app/config/routes.rb
@@ -346,10 +350,15 @@ files:
346
350
  - spec/services/forest_liana/apimap_sorter_spec.rb
347
351
  - spec/services/forest_liana/filters_parser_spec.rb
348
352
  - spec/services/forest_liana/ip_whitelist_checker_spec.rb
353
+ - spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb
354
+ - spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb
355
+ - spec/services/forest_liana/permissions_formatter_spec.rb
356
+ - spec/services/forest_liana/permissions_getter_spec.rb
349
357
  - spec/services/forest_liana/schema_adapter_spec.rb
350
358
  - spec/spec_helper.rb
351
359
  - test/dummy/README.rdoc
352
360
  - test/dummy/Rakefile
361
+ - test/dummy/app/assets/config/manifest.js
353
362
  - test/dummy/app/assets/javascripts/application.js
354
363
  - test/dummy/app/assets/stylesheets/application.css
355
364
  - test/dummy/app/controllers/application_controller.rb
@@ -503,6 +512,7 @@ test_files:
503
512
  - test/dummy/app/helpers/application_helper.rb
504
513
  - test/dummy/app/assets/javascripts/application.js
505
514
  - test/dummy/app/assets/stylesheets/application.css
515
+ - test/dummy/app/assets/config/manifest.js
506
516
  - test/dummy/app/controllers/application_controller.rb
507
517
  - test/dummy/Rakefile
508
518
  - test/dummy/bin/rake
@@ -554,10 +564,14 @@ test_files:
554
564
  - test/dummy/config/database.yml
555
565
  - test/forest_liana_test.rb
556
566
  - test/routing/route_test.rb
567
+ - spec/services/forest_liana/permissions_formatter_spec.rb
568
+ - spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb
557
569
  - spec/services/forest_liana/ip_whitelist_checker_spec.rb
570
+ - spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb
558
571
  - spec/services/forest_liana/schema_adapter_spec.rb
559
572
  - spec/services/forest_liana/apimap_sorter_spec.rb
560
573
  - spec/services/forest_liana/filters_parser_spec.rb
574
+ - spec/services/forest_liana/permissions_getter_spec.rb
561
575
  - spec/spec_helper.rb
562
576
  - spec/requests/actions_controller_spec.rb
563
577
  - spec/requests/resources_spec.rb
@@ -569,6 +583,7 @@ test_files:
569
583
  - spec/dummy/app/helpers/application_helper.rb
570
584
  - spec/dummy/app/assets/javascripts/application.js
571
585
  - spec/dummy/app/assets/stylesheets/application.css
586
+ - spec/dummy/app/assets/config/manifest.js
572
587
  - spec/dummy/app/config/routes.rb
573
588
  - spec/dummy/app/controllers/application_controller.rb
574
589
  - spec/dummy/Rakefile