access_forge-permissions 0.1.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 85be5453bc702edd5a28e20735a93f02ca11a27f7f6cd3f15befa208eaaff0e2
4
+ data.tar.gz: a3bbc2c56ebddc2c80b6161f99d48c212221a653a565e1892c997f40c9e863ae
5
+ SHA512:
6
+ metadata.gz: b8a33eb641e6bce613b70a9c7e2b8c2bfbb3fa3fd02d321783a16c8f5fbe34d5d091d99eece0824095fd552ccaf6640c89d758ba85edd55eeb7f9eedaa86f8a0
7
+ data.tar.gz: 4f6c421ba54f6ece0ae7a0d747f2960528bd45dd783827a3dd3a9dc4328e900deaad7b53af45082faa9dbdcb9c6d5e80a901a796f9dac3ce94ce5c4ba286a067
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.2
3
+
4
+ Style/StringLiterals:
5
+ EnforcedStyle: double_quotes
6
+
7
+ Style/StringLiteralsInInterpolation:
8
+ EnforcedStyle: double_quotes
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2026-02-15
4
+
5
+ - Initial release
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in access_forge.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
data/Gemfile.lock ADDED
@@ -0,0 +1,250 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ access_forge-permissions (0.1.0)
5
+ rails (>= 6.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ action_text-trix (2.1.16)
11
+ railties
12
+ actioncable (8.1.2)
13
+ actionpack (= 8.1.2)
14
+ activesupport (= 8.1.2)
15
+ nio4r (~> 2.0)
16
+ websocket-driver (>= 0.6.1)
17
+ zeitwerk (~> 2.6)
18
+ actionmailbox (8.1.2)
19
+ actionpack (= 8.1.2)
20
+ activejob (= 8.1.2)
21
+ activerecord (= 8.1.2)
22
+ activestorage (= 8.1.2)
23
+ activesupport (= 8.1.2)
24
+ mail (>= 2.8.0)
25
+ actionmailer (8.1.2)
26
+ actionpack (= 8.1.2)
27
+ actionview (= 8.1.2)
28
+ activejob (= 8.1.2)
29
+ activesupport (= 8.1.2)
30
+ mail (>= 2.8.0)
31
+ rails-dom-testing (~> 2.2)
32
+ actionpack (8.1.2)
33
+ actionview (= 8.1.2)
34
+ activesupport (= 8.1.2)
35
+ nokogiri (>= 1.8.5)
36
+ rack (>= 2.2.4)
37
+ rack-session (>= 1.0.1)
38
+ rack-test (>= 0.6.3)
39
+ rails-dom-testing (~> 2.2)
40
+ rails-html-sanitizer (~> 1.6)
41
+ useragent (~> 0.16)
42
+ actiontext (8.1.2)
43
+ action_text-trix (~> 2.1.15)
44
+ actionpack (= 8.1.2)
45
+ activerecord (= 8.1.2)
46
+ activestorage (= 8.1.2)
47
+ activesupport (= 8.1.2)
48
+ globalid (>= 0.6.0)
49
+ nokogiri (>= 1.8.5)
50
+ actionview (8.1.2)
51
+ activesupport (= 8.1.2)
52
+ builder (~> 3.1)
53
+ erubi (~> 1.11)
54
+ rails-dom-testing (~> 2.2)
55
+ rails-html-sanitizer (~> 1.6)
56
+ activejob (8.1.2)
57
+ activesupport (= 8.1.2)
58
+ globalid (>= 0.3.6)
59
+ activemodel (8.1.2)
60
+ activesupport (= 8.1.2)
61
+ activerecord (8.1.2)
62
+ activemodel (= 8.1.2)
63
+ activesupport (= 8.1.2)
64
+ timeout (>= 0.4.0)
65
+ activestorage (8.1.2)
66
+ actionpack (= 8.1.2)
67
+ activejob (= 8.1.2)
68
+ activerecord (= 8.1.2)
69
+ activesupport (= 8.1.2)
70
+ marcel (~> 1.0)
71
+ activesupport (8.1.2)
72
+ base64
73
+ bigdecimal
74
+ concurrent-ruby (~> 1.0, >= 1.3.1)
75
+ connection_pool (>= 2.2.5)
76
+ drb
77
+ i18n (>= 1.6, < 2)
78
+ json
79
+ logger (>= 1.4.2)
80
+ minitest (>= 5.1)
81
+ securerandom (>= 0.3)
82
+ tzinfo (~> 2.0, >= 2.0.5)
83
+ uri (>= 0.13.1)
84
+ ast (2.4.3)
85
+ base64 (0.3.0)
86
+ bigdecimal (4.0.1)
87
+ builder (3.3.0)
88
+ concurrent-ruby (1.3.6)
89
+ connection_pool (3.0.2)
90
+ crass (1.0.6)
91
+ date (3.5.1)
92
+ diff-lcs (1.6.2)
93
+ drb (2.2.3)
94
+ erb (6.0.1)
95
+ erubi (1.13.1)
96
+ globalid (1.3.0)
97
+ activesupport (>= 6.1)
98
+ i18n (1.14.8)
99
+ concurrent-ruby (~> 1.0)
100
+ io-console (0.8.2)
101
+ irb (1.17.0)
102
+ pp (>= 0.6.0)
103
+ prism (>= 1.3.0)
104
+ rdoc (>= 4.0.0)
105
+ reline (>= 0.4.2)
106
+ json (2.18.1)
107
+ language_server-protocol (3.17.0.5)
108
+ lint_roller (1.1.0)
109
+ logger (1.7.0)
110
+ loofah (2.25.0)
111
+ crass (~> 1.0.2)
112
+ nokogiri (>= 1.12.0)
113
+ mail (2.9.0)
114
+ logger
115
+ mini_mime (>= 0.1.1)
116
+ net-imap
117
+ net-pop
118
+ net-smtp
119
+ marcel (1.1.0)
120
+ mini_mime (1.1.5)
121
+ minitest (6.0.1)
122
+ prism (~> 1.5)
123
+ net-imap (0.6.3)
124
+ date
125
+ net-protocol
126
+ net-pop (0.1.2)
127
+ net-protocol
128
+ net-protocol (0.2.2)
129
+ timeout
130
+ net-smtp (0.5.1)
131
+ net-protocol
132
+ nio4r (2.7.5)
133
+ nokogiri (1.19.0-aarch64-linux-gnu)
134
+ racc (~> 1.4)
135
+ parallel (1.27.0)
136
+ parser (3.3.10.1)
137
+ ast (~> 2.4.1)
138
+ racc
139
+ pp (0.6.3)
140
+ prettyprint
141
+ prettyprint (0.2.0)
142
+ prism (1.9.0)
143
+ psych (5.3.1)
144
+ date
145
+ stringio
146
+ racc (1.8.1)
147
+ rack (3.2.4)
148
+ rack-session (2.1.1)
149
+ base64 (>= 0.1.0)
150
+ rack (>= 3.0.0)
151
+ rack-test (2.2.0)
152
+ rack (>= 1.3)
153
+ rackup (2.3.1)
154
+ rack (>= 3)
155
+ rails (8.1.2)
156
+ actioncable (= 8.1.2)
157
+ actionmailbox (= 8.1.2)
158
+ actionmailer (= 8.1.2)
159
+ actionpack (= 8.1.2)
160
+ actiontext (= 8.1.2)
161
+ actionview (= 8.1.2)
162
+ activejob (= 8.1.2)
163
+ activemodel (= 8.1.2)
164
+ activerecord (= 8.1.2)
165
+ activestorage (= 8.1.2)
166
+ activesupport (= 8.1.2)
167
+ bundler (>= 1.15.0)
168
+ railties (= 8.1.2)
169
+ rails-dom-testing (2.3.0)
170
+ activesupport (>= 5.0.0)
171
+ minitest
172
+ nokogiri (>= 1.6)
173
+ rails-html-sanitizer (1.6.2)
174
+ loofah (~> 2.21)
175
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
176
+ railties (8.1.2)
177
+ actionpack (= 8.1.2)
178
+ activesupport (= 8.1.2)
179
+ irb (~> 1.13)
180
+ rackup (>= 1.0.0)
181
+ rake (>= 12.2)
182
+ thor (~> 1.0, >= 1.2.2)
183
+ tsort (>= 0.2)
184
+ zeitwerk (~> 2.6)
185
+ rainbow (3.1.1)
186
+ rake (13.3.1)
187
+ rdoc (7.2.0)
188
+ erb
189
+ psych (>= 4.0.0)
190
+ tsort
191
+ regexp_parser (2.11.3)
192
+ reline (0.6.3)
193
+ io-console (~> 0.5)
194
+ rspec (3.13.2)
195
+ rspec-core (~> 3.13.0)
196
+ rspec-expectations (~> 3.13.0)
197
+ rspec-mocks (~> 3.13.0)
198
+ rspec-core (3.13.6)
199
+ rspec-support (~> 3.13.0)
200
+ rspec-expectations (3.13.5)
201
+ diff-lcs (>= 1.2.0, < 2.0)
202
+ rspec-support (~> 3.13.0)
203
+ rspec-mocks (3.13.7)
204
+ diff-lcs (>= 1.2.0, < 2.0)
205
+ rspec-support (~> 3.13.0)
206
+ rspec-support (3.13.7)
207
+ rubocop (1.84.2)
208
+ json (~> 2.3)
209
+ language_server-protocol (~> 3.17.0.2)
210
+ lint_roller (~> 1.1.0)
211
+ parallel (~> 1.10)
212
+ parser (>= 3.3.0.2)
213
+ rainbow (>= 2.2.2, < 4.0)
214
+ regexp_parser (>= 2.9.3, < 3.0)
215
+ rubocop-ast (>= 1.49.0, < 2.0)
216
+ ruby-progressbar (~> 1.7)
217
+ unicode-display_width (>= 2.4.0, < 4.0)
218
+ rubocop-ast (1.49.0)
219
+ parser (>= 3.3.7.2)
220
+ prism (~> 1.7)
221
+ ruby-progressbar (1.13.0)
222
+ securerandom (0.4.1)
223
+ stringio (3.2.0)
224
+ thor (1.5.0)
225
+ timeout (0.6.0)
226
+ tsort (0.2.0)
227
+ tzinfo (2.0.6)
228
+ concurrent-ruby (~> 1.0)
229
+ unicode-display_width (3.2.0)
230
+ unicode-emoji (~> 4.1)
231
+ unicode-emoji (4.2.0)
232
+ uri (1.1.1)
233
+ useragent (0.16.11)
234
+ websocket-driver (0.8.0)
235
+ base64
236
+ websocket-extensions (>= 0.1.0)
237
+ websocket-extensions (0.1.5)
238
+ zeitwerk (2.7.4)
239
+
240
+ PLATFORMS
241
+ aarch64-linux
242
+
243
+ DEPENDENCIES
244
+ access_forge-permissions!
245
+ rake (~> 13.0)
246
+ rspec (~> 3.0)
247
+ rubocop (~> 1.21)
248
+
249
+ BUNDLED WITH
250
+ 2.4.19
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Mark Harbison
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # AccessForge::Permissions
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/access_forge/permissions`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'access_forge-permissions'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install access_forge-permissions
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/access_forge-permissions. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the AccessForge::Permissions project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/access_forge-permissions/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/access_forge/permissions/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "access_forge-permissions"
7
+ spec.version = AccessForge::Permissions::VERSION
8
+ spec.authors = ["Mark Harbison"]
9
+ spec.email = ["mark@tyne-solutions.com"]
10
+
11
+ spec.summary = "A persistence-backed AccessForge implementation for permission based authorisation."
12
+ spec.description = "A persistence-backed AccessForge implementation for permission based authorisation."
13
+ spec.homepage = "https://github.com/CodeTectonics/access_forge-permissions"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 3.2.0"
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = spec.homepage
19
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
20
+
21
+ spec.files = `git ls-files`.split("\n")
22
+ spec.test_files = `git ls-files -- spec/*`.split("\n")
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_dependency "rails", ">= 6.1"
26
+
27
+ spec.add_development_dependency "rake", "~> 13.0"
28
+ spec.add_development_dependency "rspec", "~> 3.12"
29
+ spec.add_development_dependency "rubocop", "~> 1.21"
30
+
31
+ # For more information and examples about making a new gem, check out our
32
+ # guide at: https://bundler.io/guides/creating_gem.html
33
+ end
data/bin/console ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "access_forge/permissions"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ require "irb"
11
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AccessForge
4
+ module Permissions
5
+ class PermissionPolicyRule
6
+ def self.authorized?(user, _controller, options)
7
+ permission_name = "Can #{options[:verb]} #{options[:feature]}"
8
+ user.permissions.exists?({ permissions: { name: permission_name } })
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ module AccessForge
2
+ module Permissions
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "access_forge/permissions/version"
4
+
5
+ module AccessForge
6
+ module Permissions
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ module AccessForge
2
+ module Permissions
3
+ VERSION: String
4
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
+ end
6
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe AccessForge::Permissions do
4
+ it "has a version number" do
5
+ expect(AccessForge::Permissions::VERSION).not_to be nil
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "access_forge/permissions"
4
+
5
+ RSpec.configure do |config|
6
+ # Enable flags like --only-failures and --next-failure
7
+ config.example_status_persistence_file_path = ".rspec_status"
8
+
9
+ # Disable RSpec exposing methods globally on `Module` and `main`
10
+ config.disable_monkey_patching!
11
+
12
+ config.expect_with :rspec do |c|
13
+ c.syntax = :expect
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: access_forge-permissions
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Mark Harbison
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-02-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '6.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '6.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '13.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '13.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.12'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.12'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.21'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.21'
69
+ description: A persistence-backed AccessForge implementation for permission based
70
+ authorisation.
71
+ email:
72
+ - mark@tyne-solutions.com
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - ".rspec"
79
+ - ".rubocop.yml"
80
+ - CHANGELOG.md
81
+ - CODE_OF_CONDUCT.md
82
+ - Gemfile
83
+ - Gemfile.lock
84
+ - LICENSE.txt
85
+ - README.md
86
+ - Rakefile
87
+ - access_forge-permissions.gemspec
88
+ - bin/console
89
+ - bin/setup
90
+ - lib/access_forge/permissions.rb
91
+ - lib/access_forge/permissions/permission_policy_rule.rb
92
+ - lib/access_forge/permissions/version.rb
93
+ - sig/access_forge-permissions.rbs
94
+ - spec/access_forge/permissions_spec.rb
95
+ - spec/spec_helper.rb
96
+ homepage: https://github.com/CodeTectonics/access_forge-permissions
97
+ licenses:
98
+ - MIT
99
+ metadata:
100
+ homepage_uri: https://github.com/CodeTectonics/access_forge-permissions
101
+ source_code_uri: https://github.com/CodeTectonics/access_forge-permissions
102
+ changelog_uri: https://github.com/CodeTectonics/access_forge-permissions/blob/main/CHANGELOG.md
103
+ post_install_message:
104
+ rdoc_options: []
105
+ require_paths:
106
+ - lib
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: 3.2.0
112
+ required_rubygems_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ requirements: []
118
+ rubygems_version: 3.4.19
119
+ signing_key:
120
+ specification_version: 4
121
+ summary: A persistence-backed AccessForge implementation for permission based authorisation.
122
+ test_files:
123
+ - spec/access_forge/permissions_spec.rb
124
+ - spec/spec_helper.rb