authorizy 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +25 -11
  4. data/lib/authorizy/config.rb +1 -1
  5. data/lib/authorizy/core.rb +6 -6
  6. data/lib/authorizy/expander.rb +7 -11
  7. data/lib/authorizy/extension.rb +9 -6
  8. data/lib/authorizy/rspec.rb +3 -3
  9. data/lib/authorizy/version.rb +1 -1
  10. metadata +8 -184
  11. data/spec/authorizy/base_cop/access_question_spec.rb +0 -10
  12. data/spec/authorizy/config/aliases_spec.rb +0 -13
  13. data/spec/authorizy/config/cop_spec.rb +0 -13
  14. data/spec/authorizy/config/current_user_spec.rb +0 -29
  15. data/spec/authorizy/config/denied_spec.rb +0 -51
  16. data/spec/authorizy/config/dependencies_spec.rb +0 -13
  17. data/spec/authorizy/config/field_spec.rb +0 -29
  18. data/spec/authorizy/config/initialize_spec.rb +0 -7
  19. data/spec/authorizy/config/redirect_url_spec.rb +0 -31
  20. data/spec/authorizy/cop/controller_spec.rb +0 -41
  21. data/spec/authorizy/cop/model_spec.rb +0 -16
  22. data/spec/authorizy/cop/namespaced_controller_spec.rb +0 -41
  23. data/spec/authorizy/core/access_spec.rb +0 -181
  24. data/spec/authorizy/expander/expand_spec.rb +0 -139
  25. data/spec/authorizy/extension/authorizy_question_spec.rb +0 -50
  26. data/spec/authorizy/extension/authorizy_spec.rb +0 -54
  27. data/spec/authorizy/rspec_spec.rb +0 -11
  28. data/spec/common_helper.rb +0 -13
  29. data/spec/spec_helper.rb +0 -29
  30. data/spec/support/application.rb +0 -8
  31. data/spec/support/common.rb +0 -13
  32. data/spec/support/controllers/admin/dummy_controller.rb +0 -13
  33. data/spec/support/controllers/dummy_controller.rb +0 -11
  34. data/spec/support/coverage.rb +0 -18
  35. data/spec/support/i18n.rb +0 -3
  36. data/spec/support/locales/en.yml +0 -3
  37. data/spec/support/models/authorizy_cop.rb +0 -31
  38. data/spec/support/models/empty_cop.rb +0 -4
  39. data/spec/support/models/user.rb +0 -4
  40. data/spec/support/routes.rb +0 -6
  41. data/spec/support/schema.rb +0 -22
@@ -1,3 +0,0 @@
1
- en:
2
- authorizy:
3
- denied: "Action denied for %{controller}#%{action}"
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class AuthorizyCop < Authorizy::BaseCop
4
- def admin__dummy
5
- params[:admin] == 'true'
6
- end
7
-
8
- def dummy
9
- params[:access] == 'true'
10
- end
11
-
12
- def fetch_action
13
- action
14
- end
15
-
16
- def fetch_controller
17
- controller
18
- end
19
-
20
- def fetch_current_user
21
- current_user
22
- end
23
-
24
- def fetch_params
25
- params
26
- end
27
-
28
- def fetch_session
29
- session
30
- end
31
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class EmptyCop < Authorizy::BaseCop
4
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class User < ActiveRecord::Base
4
- end
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- Rails.application.routes.draw do
4
- get :action, to: 'admin/dummy#action'
5
- get :action, to: 'dummy#action'
6
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'active_record'
4
- require 'support/models/user'
5
-
6
- ActiveRecord::Base.establish_connection(
7
- adapter: 'postgresql',
8
- host: 'localhost',
9
- username: 'postgres'
10
- )
11
-
12
- ActiveRecord::Base.connection.execute('DROP DATABASE IF EXISTS authorizy_test;')
13
- ActiveRecord::Base.connection.execute('CREATE DATABASE authorizy_test;')
14
- ActiveRecord::Base.connection.execute('DROP TABLE IF EXISTS users;')
15
-
16
- ActiveRecord::Schema.define(version: 1) do
17
- enable_extension 'plpgsql'
18
-
19
- create_table :users do |t|
20
- t.jsonb 'authorizy', default: {}
21
- end
22
- end