current_scope 0.5.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 (58) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +377 -0
  4. data/Rakefile +6 -0
  5. data/app/assets/javascripts/current_scope/application.js +229 -0
  6. data/app/assets/stylesheets/current_scope/application.css +917 -0
  7. data/app/controllers/current_scope/application_controller.rb +96 -0
  8. data/app/controllers/current_scope/events_controller.rb +14 -0
  9. data/app/controllers/current_scope/role_assignments_controller.rb +190 -0
  10. data/app/controllers/current_scope/roles_controller.rb +256 -0
  11. data/app/controllers/current_scope/scoped_role_assignments_controller.rb +165 -0
  12. data/app/controllers/current_scope/subjects_controller.rb +75 -0
  13. data/app/helpers/current_scope/application_helper.rb +261 -0
  14. data/app/models/concerns/current_scope/storable_keys.rb +101 -0
  15. data/app/models/current_scope/application_record.rb +5 -0
  16. data/app/models/current_scope/current.rb +74 -0
  17. data/app/models/current_scope/event.rb +136 -0
  18. data/app/models/current_scope/role.rb +106 -0
  19. data/app/models/current_scope/role_assignment.rb +42 -0
  20. data/app/models/current_scope/role_permission.rb +9 -0
  21. data/app/models/current_scope/scoped_role_assignment.rb +98 -0
  22. data/app/views/current_scope/events/index.html.erb +41 -0
  23. data/app/views/current_scope/roles/edit.html.erb +229 -0
  24. data/app/views/current_scope/roles/index.html.erb +55 -0
  25. data/app/views/current_scope/roles/members.html.erb +114 -0
  26. data/app/views/current_scope/roles/new.html.erb +19 -0
  27. data/app/views/current_scope/scoped_role_assignments/new.html.erb +144 -0
  28. data/app/views/current_scope/shared/access_denied.html.erb +30 -0
  29. data/app/views/current_scope/subjects/index.html.erb +124 -0
  30. data/app/views/layouts/current_scope/application.html.erb +56 -0
  31. data/config/routes.rb +13 -0
  32. data/db/migrate/20260710000001_create_current_scope_tables.rb +31 -0
  33. data/db/migrate/20260710000002_create_current_scope_events.rb +32 -0
  34. data/db/migrate/20260714000001_add_description_to_current_scope_roles.rb +5 -0
  35. data/db/migrate/20260805000001_widen_current_scope_polymorphic_ids.rb +165 -0
  36. data/lib/current_scope/configuration.rb +613 -0
  37. data/lib/current_scope/context.rb +41 -0
  38. data/lib/current_scope/engine.rb +202 -0
  39. data/lib/current_scope/gating_reflection.rb +113 -0
  40. data/lib/current_scope/gating_tripwire.rb +84 -0
  41. data/lib/current_scope/grant_diagnosis.rb +216 -0
  42. data/lib/current_scope/guard.rb +750 -0
  43. data/lib/current_scope/mutation_guard.rb +90 -0
  44. data/lib/current_scope/parent_chain.rb +397 -0
  45. data/lib/current_scope/permission_catalog.rb +146 -0
  46. data/lib/current_scope/permission_grid.rb +132 -0
  47. data/lib/current_scope/permissions.rb +94 -0
  48. data/lib/current_scope/resolver.rb +669 -0
  49. data/lib/current_scope/schema_guard.rb +223 -0
  50. data/lib/current_scope/scopeable.rb +38 -0
  51. data/lib/current_scope/sod_preflight.rb +380 -0
  52. data/lib/current_scope/test_helpers.rb +53 -0
  53. data/lib/current_scope/version.rb +3 -0
  54. data/lib/current_scope.rb +432 -0
  55. data/lib/generators/current_scope/install/install_generator.rb +114 -0
  56. data/lib/generators/current_scope/install/templates/initializer.rb +175 -0
  57. data/lib/tasks/current_scope_tasks.rake +454 -0
  58. metadata +123 -0
metadata ADDED
@@ -0,0 +1,123 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: current_scope
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ platform: ruby
6
+ authors:
7
+ - David Teren
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: rails
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '8.1'
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '9'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '8.1'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '9'
32
+ description: 'A mountable Rails engine for authorization: permissions auto-derived
33
+ from controller actions, roles as editable data, per-record scoped roles, a separation-of-duties
34
+ veto, and an ambient authorization context that makes allowed_to? work identically
35
+ in controllers, views, and components. NOT PRODUCTION-READY: pre-1.0 with known
36
+ issues under active work — good for experimentation and spikes, not yet for real
37
+ users. See the README and the issue tracker.'
38
+ email:
39
+ - dteren@gmail.com
40
+ executables: []
41
+ extensions: []
42
+ extra_rdoc_files: []
43
+ files:
44
+ - MIT-LICENSE
45
+ - README.md
46
+ - Rakefile
47
+ - app/assets/javascripts/current_scope/application.js
48
+ - app/assets/stylesheets/current_scope/application.css
49
+ - app/controllers/current_scope/application_controller.rb
50
+ - app/controllers/current_scope/events_controller.rb
51
+ - app/controllers/current_scope/role_assignments_controller.rb
52
+ - app/controllers/current_scope/roles_controller.rb
53
+ - app/controllers/current_scope/scoped_role_assignments_controller.rb
54
+ - app/controllers/current_scope/subjects_controller.rb
55
+ - app/helpers/current_scope/application_helper.rb
56
+ - app/models/concerns/current_scope/storable_keys.rb
57
+ - app/models/current_scope/application_record.rb
58
+ - app/models/current_scope/current.rb
59
+ - app/models/current_scope/event.rb
60
+ - app/models/current_scope/role.rb
61
+ - app/models/current_scope/role_assignment.rb
62
+ - app/models/current_scope/role_permission.rb
63
+ - app/models/current_scope/scoped_role_assignment.rb
64
+ - app/views/current_scope/events/index.html.erb
65
+ - app/views/current_scope/roles/edit.html.erb
66
+ - app/views/current_scope/roles/index.html.erb
67
+ - app/views/current_scope/roles/members.html.erb
68
+ - app/views/current_scope/roles/new.html.erb
69
+ - app/views/current_scope/scoped_role_assignments/new.html.erb
70
+ - app/views/current_scope/shared/access_denied.html.erb
71
+ - app/views/current_scope/subjects/index.html.erb
72
+ - app/views/layouts/current_scope/application.html.erb
73
+ - config/routes.rb
74
+ - db/migrate/20260710000001_create_current_scope_tables.rb
75
+ - db/migrate/20260710000002_create_current_scope_events.rb
76
+ - db/migrate/20260714000001_add_description_to_current_scope_roles.rb
77
+ - db/migrate/20260805000001_widen_current_scope_polymorphic_ids.rb
78
+ - lib/current_scope.rb
79
+ - lib/current_scope/configuration.rb
80
+ - lib/current_scope/context.rb
81
+ - lib/current_scope/engine.rb
82
+ - lib/current_scope/gating_reflection.rb
83
+ - lib/current_scope/gating_tripwire.rb
84
+ - lib/current_scope/grant_diagnosis.rb
85
+ - lib/current_scope/guard.rb
86
+ - lib/current_scope/mutation_guard.rb
87
+ - lib/current_scope/parent_chain.rb
88
+ - lib/current_scope/permission_catalog.rb
89
+ - lib/current_scope/permission_grid.rb
90
+ - lib/current_scope/permissions.rb
91
+ - lib/current_scope/resolver.rb
92
+ - lib/current_scope/schema_guard.rb
93
+ - lib/current_scope/scopeable.rb
94
+ - lib/current_scope/sod_preflight.rb
95
+ - lib/current_scope/test_helpers.rb
96
+ - lib/current_scope/version.rb
97
+ - lib/generators/current_scope/install/install_generator.rb
98
+ - lib/generators/current_scope/install/templates/initializer.rb
99
+ - lib/tasks/current_scope_tasks.rake
100
+ homepage: https://github.com/davidteren/current_scope
101
+ licenses:
102
+ - MIT
103
+ metadata:
104
+ changelog_uri: https://github.com/davidteren/current_scope/blob/main/CHANGELOG.md
105
+ rubygems_mfa_required: 'true'
106
+ rdoc_options: []
107
+ require_paths:
108
+ - lib
109
+ required_ruby_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '3.2'
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ requirements: []
120
+ rubygems_version: 3.6.9
121
+ specification_version: 4
122
+ summary: Data-driven authorization for Rails with an ambient current-user context.
123
+ test_files: []