forest_liana 5.3.3 → 5.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/forest_liana/actions_controller.rb +12 -2
  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/serializers/forest_liana/stripe_invoice_serializer.rb +5 -5
  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/resource_creator.rb +1 -1
  10. data/app/services/forest_liana/resource_updater.rb +3 -3
  11. data/app/services/forest_liana/schema_utils.rb +8 -3
  12. data/app/services/forest_liana/scope_validator.rb +8 -7
  13. data/app/services/forest_liana/stripe_invoice_getter.rb +1 -1
  14. data/app/services/forest_liana/stripe_invoices_getter.rb +1 -1
  15. data/app/services/forest_liana/stripe_source_getter.rb +1 -1
  16. data/app/services/forest_liana/stripe_sources_getter.rb +1 -1
  17. data/app/services/forest_liana/utils/beta_schema_utils.rb +13 -0
  18. data/lib/forest_liana/bootstrapper.rb +5 -5
  19. data/lib/forest_liana/version.rb +1 -1
  20. data/spec/dummy/app/assets/config/manifest.js +1 -0
  21. data/spec/dummy/config/application.rb +1 -1
  22. data/spec/dummy/db/migrate/20190226172951_create_user.rb +1 -1
  23. data/spec/dummy/db/migrate/20190226173051_create_isle.rb +1 -1
  24. data/spec/dummy/db/migrate/20190226174951_create_tree.rb +1 -1
  25. data/spec/dummy/db/migrate/20190716130830_add_age_to_tree.rb +1 -1
  26. data/spec/dummy/db/migrate/20190716135241_add_type_to_user.rb +1 -1
  27. data/spec/dummy/db/schema.rb +18 -20
  28. data/spec/requests/actions_controller_spec.rb +59 -11
  29. data/spec/requests/resources_spec.rb +4 -4
  30. data/spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb +711 -0
  31. data/spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb +831 -0
  32. data/spec/services/forest_liana/permissions_formatter_spec.rb +222 -0
  33. data/spec/services/forest_liana/permissions_getter_spec.rb +82 -0
  34. data/spec/spec_helper.rb +3 -0
  35. data/test/dummy/app/assets/config/manifest.js +1 -0
  36. data/test/dummy/config/application.rb +1 -1
  37. data/test/dummy/db/migrate/20150608130516_create_date_field.rb +1 -1
  38. data/test/dummy/db/migrate/20150608131430_create_integer_field.rb +1 -1
  39. data/test/dummy/db/migrate/20150608131603_create_decimal_field.rb +1 -1
  40. data/test/dummy/db/migrate/20150608131610_create_float_field.rb +1 -1
  41. data/test/dummy/db/migrate/20150608132159_create_boolean_field.rb +1 -1
  42. data/test/dummy/db/migrate/20150608132621_create_string_field.rb +1 -1
  43. data/test/dummy/db/migrate/20150608133038_create_belongs_to_field.rb +1 -1
  44. data/test/dummy/db/migrate/20150608133044_create_has_one_field.rb +1 -1
  45. data/test/dummy/db/migrate/20150608150016_create_has_many_field.rb +1 -1
  46. data/test/dummy/db/migrate/20150609114636_create_belongs_to_class_name_field.rb +1 -1
  47. data/test/dummy/db/migrate/20150612112520_create_has_and_belongs_to_many_field.rb +1 -1
  48. data/test/dummy/db/migrate/20150616150629_create_polymorphic_field.rb +1 -1
  49. data/test/dummy/db/migrate/20150623115554_create_has_many_class_name_field.rb +1 -1
  50. data/test/dummy/db/migrate/20150814081918_create_has_many_through_field.rb +1 -1
  51. data/test/dummy/db/migrate/20160627172810_create_owner.rb +1 -1
  52. data/test/dummy/db/migrate/20160627172951_create_tree.rb +1 -1
  53. data/test/dummy/db/migrate/20160628173505_add_timestamps.rb +1 -1
  54. data/test/dummy/db/migrate/20170614141921_create_serialize_field.rb +1 -1
  55. data/test/dummy/db/migrate/20181111162121_create_references_table.rb +1 -1
  56. data/test/services/forest_liana/resources_getter_test.rb +1 -1
  57. metadata +119 -105
@@ -1,4 +1,4 @@
1
- class CreateSerializeField < ActiveRecord::Migration
1
+ class CreateSerializeField < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :serialize_fields do |t|
4
4
  t.string :field
@@ -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.3
4
+ version: 5.4.4
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-08 00:00:00.000000000 Z
11
+ date: 2021-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -255,6 +255,7 @@ files:
255
255
  - app/services/forest_liana/objective_stat_getter.rb
256
256
  - app/services/forest_liana/operator_date_interval_parser.rb
257
257
  - app/services/forest_liana/permissions_checker.rb
258
+ - app/services/forest_liana/permissions_formatter.rb
258
259
  - app/services/forest_liana/permissions_getter.rb
259
260
  - app/services/forest_liana/pie_stat_getter.rb
260
261
  - app/services/forest_liana/query_stat_getter.rb
@@ -279,6 +280,7 @@ files:
279
280
  - app/services/forest_liana/stripe_subscriptions_getter.rb
280
281
  - app/services/forest_liana/two_factor_registration_confirmer.rb
281
282
  - app/services/forest_liana/user_secret_creator.rb
283
+ - app/services/forest_liana/utils/beta_schema_utils.rb
282
284
  - app/services/forest_liana/value_stat_getter.rb
283
285
  - app/views/layouts/forest_liana/application.html.erb
284
286
  - config/initializers/arel-helpers.rb
@@ -300,6 +302,7 @@ files:
300
302
  - lib/tasks/send_apimap.rake
301
303
  - spec/dummy/README.rdoc
302
304
  - spec/dummy/Rakefile
305
+ - spec/dummy/app/assets/config/manifest.js
303
306
  - spec/dummy/app/assets/javascripts/application.js
304
307
  - spec/dummy/app/assets/stylesheets/application.css
305
308
  - spec/dummy/app/config/routes.rb
@@ -347,10 +350,15 @@ files:
347
350
  - spec/services/forest_liana/apimap_sorter_spec.rb
348
351
  - spec/services/forest_liana/filters_parser_spec.rb
349
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
350
357
  - spec/services/forest_liana/schema_adapter_spec.rb
351
358
  - spec/spec_helper.rb
352
359
  - test/dummy/README.rdoc
353
360
  - test/dummy/Rakefile
361
+ - test/dummy/app/assets/config/manifest.js
354
362
  - test/dummy/app/assets/javascripts/application.js
355
363
  - test/dummy/app/assets/stylesheets/application.css
356
364
  - test/dummy/app/controllers/application_controller.rb
@@ -459,150 +467,156 @@ required_rubygems_version: !ruby/object:Gem::Requirement
459
467
  - !ruby/object:Gem::Version
460
468
  version: '0'
461
469
  requirements: []
462
- rubygems_version: 3.0.8
470
+ rubygems_version: 3.1.2
463
471
  signing_key:
464
472
  specification_version: 4
465
473
  summary: Official Rails Liana for Forest
466
474
  test_files:
467
- - test/fixtures/owner.yml
468
- - test/fixtures/belongs_to_field.yml
469
- - test/fixtures/has_many_through_field.yml
470
- - test/fixtures/tree.yml
471
- - test/fixtures/has_one_field.yml
472
- - test/fixtures/reference.yml
473
- - test/fixtures/serialize_field.yml
474
- - test/fixtures/has_many_field.yml
475
- - test/fixtures/string_field.yml
476
- - test/services/forest_liana/resources_getter_test.rb
477
- - test/services/forest_liana/scope_validator_test.rb
478
- - test/services/forest_liana/schema_adapter_test.rb
479
- - test/services/forest_liana/has_many_getter_test.rb
480
- - test/services/forest_liana/value_stat_getter_test.rb
481
- - test/services/forest_liana/resource_updater_test.rb
482
- - test/services/forest_liana/pie_stat_getter_test.rb
483
- - test/test_helper.rb
484
- - test/dummy/README.rdoc
475
+ - test/dummy/app/assets/stylesheets/application.css
476
+ - test/dummy/app/assets/config/manifest.js
477
+ - test/dummy/app/assets/javascripts/application.js
485
478
  - test/dummy/app/views/layouts/application.html.erb
479
+ - test/dummy/app/controllers/application_controller.rb
480
+ - test/dummy/app/helpers/application_helper.rb
481
+ - test/dummy/app/models/reference.rb
482
+ - test/dummy/app/models/float_field.rb
486
483
  - test/dummy/app/models/has_many_field.rb
484
+ - test/dummy/app/models/polymorphic_field.rb
485
+ - test/dummy/app/models/decimal_field.rb
487
486
  - test/dummy/app/models/string_field.rb
488
- - test/dummy/app/models/has_and_belongs_to_many_field.rb
487
+ - test/dummy/app/models/serialize_field.rb
488
+ - test/dummy/app/models/tree.rb
489
+ - test/dummy/app/models/boolean_field.rb
490
+ - test/dummy/app/models/date_field.rb
489
491
  - test/dummy/app/models/has_many_through_field.rb
490
- - test/dummy/app/models/has_many_class_name_field.rb
492
+ - test/dummy/app/models/owner.rb
491
493
  - test/dummy/app/models/has_one_field.rb
492
- - test/dummy/app/models/date_field.rb
493
- - test/dummy/app/models/boolean_field.rb
494
- - test/dummy/app/models/float_field.rb
495
- - test/dummy/app/models/reference.rb
494
+ - test/dummy/app/models/has_many_class_name_field.rb
496
495
  - test/dummy/app/models/belongs_to_class_name_field.rb
497
- - test/dummy/app/models/polymorphic_field.rb
498
- - test/dummy/app/models/tree.rb
499
- - test/dummy/app/models/decimal_field.rb
500
- - test/dummy/app/models/serialize_field.rb
501
496
  - test/dummy/app/models/integer_field.rb
502
497
  - test/dummy/app/models/belongs_to_field.rb
503
- - test/dummy/app/models/owner.rb
504
- - test/dummy/app/helpers/application_helper.rb
505
- - test/dummy/app/assets/javascripts/application.js
506
- - test/dummy/app/assets/stylesheets/application.css
507
- - test/dummy/app/controllers/application_controller.rb
508
- - test/dummy/Rakefile
509
- - test/dummy/bin/rake
510
- - test/dummy/bin/bundle
511
- - test/dummy/bin/rails
512
- - test/dummy/bin/setup
513
- - test/dummy/public/404.html
514
- - test/dummy/public/500.html
515
- - test/dummy/public/422.html
516
- - test/dummy/public/favicon.ico
517
- - test/dummy/config.ru
518
- - test/dummy/db/migrate/20181111162121_create_references_table.rb
519
- - test/dummy/db/migrate/20150608131430_create_integer_field.rb
520
- - test/dummy/db/migrate/20160628173505_add_timestamps.rb
521
- - test/dummy/db/migrate/20160627172810_create_owner.rb
522
- - test/dummy/db/migrate/20150814081918_create_has_many_through_field.rb
498
+ - test/dummy/app/models/has_and_belongs_to_many_field.rb
499
+ - test/dummy/db/migrate/20160627172951_create_tree.rb
523
500
  - test/dummy/db/migrate/20150608132159_create_boolean_field.rb
524
- - test/dummy/db/migrate/20150608131603_create_decimal_field.rb
525
- - test/dummy/db/migrate/20150616150629_create_polymorphic_field.rb
526
501
  - test/dummy/db/migrate/20150612112520_create_has_and_belongs_to_many_field.rb
527
- - test/dummy/db/migrate/20150608131610_create_float_field.rb
528
- - test/dummy/db/migrate/20150608133038_create_belongs_to_field.rb
529
- - test/dummy/db/migrate/20150608150016_create_has_many_field.rb
502
+ - test/dummy/db/migrate/20160627172810_create_owner.rb
530
503
  - test/dummy/db/migrate/20150609114636_create_belongs_to_class_name_field.rb
504
+ - test/dummy/db/migrate/20150608130516_create_date_field.rb
505
+ - test/dummy/db/migrate/20160628173505_add_timestamps.rb
506
+ - test/dummy/db/migrate/20150608131610_create_float_field.rb
531
507
  - test/dummy/db/migrate/20170614141921_create_serialize_field.rb
508
+ - test/dummy/db/migrate/20150608150016_create_has_many_field.rb
509
+ - test/dummy/db/migrate/20150608131430_create_integer_field.rb
510
+ - test/dummy/db/migrate/20150608133038_create_belongs_to_field.rb
511
+ - test/dummy/db/migrate/20150616150629_create_polymorphic_field.rb
532
512
  - test/dummy/db/migrate/20150608132621_create_string_field.rb
533
- - test/dummy/db/migrate/20150608133044_create_has_one_field.rb
513
+ - test/dummy/db/migrate/20181111162121_create_references_table.rb
534
514
  - test/dummy/db/migrate/20150623115554_create_has_many_class_name_field.rb
535
- - test/dummy/db/migrate/20150608130516_create_date_field.rb
536
- - test/dummy/db/migrate/20160627172951_create_tree.rb
515
+ - test/dummy/db/migrate/20150608133044_create_has_one_field.rb
516
+ - test/dummy/db/migrate/20150814081918_create_has_many_through_field.rb
517
+ - test/dummy/db/migrate/20150608131603_create_decimal_field.rb
537
518
  - test/dummy/db/schema.rb
538
- - test/dummy/config/routes.rb
539
- - test/dummy/config/environment.rb
519
+ - test/dummy/config.ru
520
+ - test/dummy/README.rdoc
540
521
  - test/dummy/config/secrets.yml
541
- - test/dummy/config/application.rb
542
- - test/dummy/config/boot.rb
543
- - test/dummy/config/environments/test.rb
544
- - test/dummy/config/environments/development.rb
545
- - test/dummy/config/environments/production.rb
546
522
  - test/dummy/config/locales/en.yml
523
+ - test/dummy/config/routes.rb
524
+ - test/dummy/config/database.yml
547
525
  - test/dummy/config/initializers/wrap_parameters.rb
548
- - test/dummy/config/initializers/mime_types.rb
549
- - test/dummy/config/initializers/filter_parameter_logging.rb
550
526
  - test/dummy/config/initializers/assets.rb
527
+ - test/dummy/config/initializers/filter_parameter_logging.rb
551
528
  - test/dummy/config/initializers/session_store.rb
529
+ - test/dummy/config/initializers/backtrace_silencers.rb
552
530
  - test/dummy/config/initializers/inflections.rb
553
531
  - test/dummy/config/initializers/cookies_serializer.rb
554
- - test/dummy/config/initializers/backtrace_silencers.rb
555
- - test/dummy/config/database.yml
532
+ - test/dummy/config/initializers/mime_types.rb
533
+ - test/dummy/config/application.rb
534
+ - test/dummy/config/environments/development.rb
535
+ - test/dummy/config/environments/production.rb
536
+ - test/dummy/config/environments/test.rb
537
+ - test/dummy/config/environment.rb
538
+ - test/dummy/config/boot.rb
539
+ - test/dummy/public/500.html
540
+ - test/dummy/public/favicon.ico
541
+ - test/dummy/public/404.html
542
+ - test/dummy/public/422.html
543
+ - test/dummy/Rakefile
544
+ - test/dummy/bin/rake
545
+ - test/dummy/bin/setup
546
+ - test/dummy/bin/rails
547
+ - test/dummy/bin/bundle
556
548
  - test/forest_liana_test.rb
549
+ - test/services/forest_liana/schema_adapter_test.rb
550
+ - test/services/forest_liana/pie_stat_getter_test.rb
551
+ - test/services/forest_liana/value_stat_getter_test.rb
552
+ - test/services/forest_liana/has_many_getter_test.rb
553
+ - test/services/forest_liana/resource_updater_test.rb
554
+ - test/services/forest_liana/scope_validator_test.rb
555
+ - test/services/forest_liana/resources_getter_test.rb
556
+ - test/test_helper.rb
557
557
  - test/routing/route_test.rb
558
- - spec/services/forest_liana/ip_whitelist_checker_spec.rb
559
- - spec/services/forest_liana/schema_adapter_spec.rb
560
- - spec/services/forest_liana/apimap_sorter_spec.rb
561
- - spec/services/forest_liana/filters_parser_spec.rb
562
- - spec/spec_helper.rb
563
- - spec/requests/actions_controller_spec.rb
564
- - spec/requests/resources_spec.rb
565
- - spec/dummy/README.rdoc
566
- - spec/dummy/app/views/layouts/application.html.erb
567
- - spec/dummy/app/models/island.rb
568
- - spec/dummy/app/models/user.rb
569
- - spec/dummy/app/models/tree.rb
570
- - spec/dummy/app/helpers/application_helper.rb
571
- - spec/dummy/app/assets/javascripts/application.js
558
+ - test/fixtures/reference.yml
559
+ - test/fixtures/has_many_through_field.yml
560
+ - test/fixtures/has_many_field.yml
561
+ - test/fixtures/tree.yml
562
+ - test/fixtures/belongs_to_field.yml
563
+ - test/fixtures/owner.yml
564
+ - test/fixtures/serialize_field.yml
565
+ - test/fixtures/string_field.yml
566
+ - test/fixtures/has_one_field.yml
567
+ - spec/rails_helper.rb
572
568
  - spec/dummy/app/assets/stylesheets/application.css
569
+ - spec/dummy/app/assets/config/manifest.js
570
+ - spec/dummy/app/assets/javascripts/application.js
571
+ - spec/dummy/app/views/layouts/application.html.erb
573
572
  - spec/dummy/app/config/routes.rb
574
573
  - spec/dummy/app/controllers/application_controller.rb
575
- - spec/dummy/Rakefile
576
- - spec/dummy/bin/rake
577
- - spec/dummy/bin/bundle
578
- - spec/dummy/bin/rails
579
- - spec/dummy/bin/setup
580
- - spec/dummy/config.ru
581
- - spec/dummy/db/migrate/20190226174951_create_tree.rb
582
- - spec/dummy/db/migrate/20190716135241_add_type_to_user.rb
574
+ - spec/dummy/app/helpers/application_helper.rb
575
+ - spec/dummy/app/models/user.rb
576
+ - spec/dummy/app/models/island.rb
577
+ - spec/dummy/app/models/tree.rb
583
578
  - spec/dummy/db/migrate/20190226173051_create_isle.rb
584
579
  - spec/dummy/db/migrate/20190716130830_add_age_to_tree.rb
580
+ - spec/dummy/db/migrate/20190226174951_create_tree.rb
581
+ - spec/dummy/db/migrate/20190716135241_add_type_to_user.rb
585
582
  - spec/dummy/db/migrate/20190226172951_create_user.rb
586
583
  - spec/dummy/db/schema.rb
587
- - spec/dummy/config/routes.rb
588
- - spec/dummy/config/environment.rb
584
+ - spec/dummy/config.ru
585
+ - spec/dummy/README.rdoc
589
586
  - spec/dummy/config/secrets.yml
590
- - spec/dummy/config/application.rb
591
- - spec/dummy/config/boot.rb
592
- - spec/dummy/config/environments/test.rb
593
- - spec/dummy/config/environments/development.rb
594
- - spec/dummy/config/environments/production.rb
587
+ - spec/dummy/config/routes.rb
588
+ - spec/dummy/config/database.yml
595
589
  - spec/dummy/config/initializers/wrap_parameters.rb
590
+ - spec/dummy/config/initializers/assets.rb
596
591
  - spec/dummy/config/initializers/forest_liana.rb
597
- - spec/dummy/config/initializers/mime_types.rb
598
592
  - spec/dummy/config/initializers/filter_parameter_logging.rb
599
- - spec/dummy/config/initializers/assets.rb
600
593
  - spec/dummy/config/initializers/session_store.rb
594
+ - spec/dummy/config/initializers/backtrace_silencers.rb
601
595
  - spec/dummy/config/initializers/inflections.rb
602
596
  - spec/dummy/config/initializers/cookies_serializer.rb
603
- - spec/dummy/config/initializers/backtrace_silencers.rb
604
- - spec/dummy/config/database.yml
597
+ - spec/dummy/config/initializers/mime_types.rb
598
+ - spec/dummy/config/application.rb
599
+ - spec/dummy/config/environments/development.rb
600
+ - spec/dummy/config/environments/production.rb
601
+ - spec/dummy/config/environments/test.rb
602
+ - spec/dummy/config/environment.rb
603
+ - spec/dummy/config/boot.rb
604
+ - spec/dummy/Rakefile
605
+ - spec/dummy/bin/rake
606
+ - spec/dummy/bin/setup
607
+ - spec/dummy/bin/rails
608
+ - spec/dummy/bin/bundle
609
+ - spec/services/forest_liana/schema_adapter_spec.rb
610
+ - spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb
611
+ - spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb
612
+ - spec/services/forest_liana/permissions_formatter_spec.rb
613
+ - spec/services/forest_liana/apimap_sorter_spec.rb
614
+ - spec/services/forest_liana/permissions_getter_spec.rb
615
+ - spec/services/forest_liana/ip_whitelist_checker_spec.rb
616
+ - spec/services/forest_liana/filters_parser_spec.rb
617
+ - spec/helpers/forest_liana/query_helper_spec.rb
605
618
  - spec/helpers/forest_liana/schema_helper_spec.rb
606
619
  - spec/helpers/forest_liana/is_same_data_structure_helper_spec.rb
607
- - spec/helpers/forest_liana/query_helper_spec.rb
608
- - spec/rails_helper.rb
620
+ - spec/requests/actions_controller_spec.rb
621
+ - spec/requests/resources_spec.rb
622
+ - spec/spec_helper.rb