account_authz 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 +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +45 -0
- data/Rakefile +11 -0
- data/app/controllers/account_authz/application_controller.rb +19 -0
- data/app/controllers/account_authz/invitations_controller.rb +30 -0
- data/app/controllers/account_authz/member_roles_controller.rb +27 -0
- data/app/controllers/account_authz/members_controller.rb +38 -0
- data/app/controllers/account_authz/roles_controller.rb +56 -0
- data/app/controllers/concerns/account_authz/authorization.rb +18 -0
- data/app/helpers/account_authz/app_routes_helper.rb +12 -0
- data/app/helpers/account_authz/application_helper.rb +4 -0
- data/app/models/account_authz/account_id.rb +9 -0
- data/app/models/account_authz/acting_member.rb +11 -0
- data/app/models/account_authz/application_record.rb +5 -0
- data/app/models/account_authz/assignment.rb +8 -0
- data/app/models/account_authz/cancel_invitation.rb +23 -0
- data/app/models/account_authz/current.rb +7 -0
- data/app/models/account_authz/give_role.rb +34 -0
- data/app/models/account_authz/invite.rb +17 -0
- data/app/models/account_authz/last_manager.rb +43 -0
- data/app/models/account_authz/reach.rb +46 -0
- data/app/models/account_authz/remove_member.rb +34 -0
- data/app/models/account_authz/resend_invitation.rb +23 -0
- data/app/models/account_authz/result.rb +24 -0
- data/app/models/account_authz/role.rb +24 -0
- data/app/models/account_authz/take_role.rb +35 -0
- data/app/models/concerns/account_authz/member.rb +33 -0
- data/app/policies/account_authz/application_policy.rb +16 -0
- data/app/views/account_authz/invitations/new.html.erb +10 -0
- data/app/views/account_authz/members/_team.html.erb +84 -0
- data/app/views/account_authz/members/index.html.erb +59 -0
- data/app/views/account_authz/members/show.html.erb +38 -0
- data/app/views/account_authz/roles/_form.html.erb +16 -0
- data/app/views/account_authz/roles/edit.html.erb +4 -0
- data/app/views/account_authz/roles/index.html.erb +21 -0
- data/app/views/account_authz/roles/new.html.erb +4 -0
- data/config/locales/en.yml +10 -0
- data/config/routes.rb +9 -0
- data/db/migrate/20260607000001_create_citizen_roles.rb +15 -0
- data/db/migrate/20260607000002_create_citizen_assignments.rb +15 -0
- data/db/migrate/20260916000001_add_rank_to_citizen_roles.rb +7 -0
- data/db/migrate/20260921220000_rename_citizen_tables_to_account_authz.rb +9 -0
- data/lib/account_authz/catalog.rb +24 -0
- data/lib/account_authz/engine.rb +7 -0
- data/lib/account_authz/reference/guide.md +227 -0
- data/lib/account_authz/reference.rb +17 -0
- data/lib/account_authz/templates.rb +27 -0
- data/lib/account_authz/version.rb +5 -0
- data/lib/account_authz.rb +59 -0
- data/lib/tasks/account_authz_tasks.rake +4 -0
- data/the_local/agents/account_authz-develop.md +252 -0
- data/the_local/agents/account_authz-info.md +222 -0
- data/the_local/agents/account_authz-install.md +80 -0
- data/the_local/interface.yml +71 -0
- metadata +160 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: account_authz-install
|
|
3
|
+
description: Use to hook account_authz into a project — adding the gem, installing its migrations, choosing the account membership model and including AccountAuthz::Member in it, including AccountAuthz::Authorization in controllers, setting AccountAuthz::Current.account_id per request, and mounting AccountAuthz::Engine for the members and role pages.
|
|
4
|
+
tools: Bash, Read, Edit
|
|
5
|
+
scope: authorization — capability catalog, roles, and Pundit enforcement in multi-tenant Rails apps
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You follow the steps below exactly, in order, and invent none. Where a step says to ask the developer, ask and wait for the answer.
|
|
9
|
+
|
|
10
|
+
## What account_authz is
|
|
11
|
+
A Rails engine for capability-based authorization in multi-tenant apps, hooked in when a host needs account-scoped roles enforced through Pundit.
|
|
12
|
+
|
|
13
|
+
## Interface
|
|
14
|
+
- `gem "account_authz"` — adds the engine to the host's Gemfile, and brings in `rails`, `pundit` and `keystone_ui` as dependencies.
|
|
15
|
+
- `bin/rails account_authz:install:migrations` — copies the engine's three migrations into the host's `db/migrate/`.
|
|
16
|
+
- `AccountAuthz::Member` — a model concern included in the host model that holds roles, normally the record for a person inside one account, giving it role assignments.
|
|
17
|
+
- `AccountAuthz::Authorization` — a controller concern that includes `Pundit::Authorization` and adds a `can?(capability)` helper to controllers and views.
|
|
18
|
+
- `AccountAuthz::Current.account_id` — the per-request account that the `can?` helper scopes its answer to.
|
|
19
|
+
- `mount AccountAuthz::Engine` — a line in the host's `config/routes.rb` that serves two sets of pages for the current account. The members page lists each member with their name, email and roles, gives or takes away roles ranked below the viewer's own, invites a person by name and email, lists the invitations still waiting with a button to send each again and one to cancel it, and removes a member from the account. The role pages list the account's roles, create a role, add a role from a default template, and change a role's name, rank or capabilities, limited to roles ranked below the viewer unless the viewer holds the top rank, ranks up to the viewer's own and capabilities the viewer holds. The members page links to the roles page for a viewer who holds the roles capability, and the roles page links back to the members page. All of them are built from keystone_ui components and shown inside the host's own layout.
|
|
20
|
+
|
|
21
|
+
## How to use it
|
|
22
|
+
1. Confirm the host runs Ruby 3.2 or later and Rails 7.1 or later.
|
|
23
|
+
2. Ask the developer which source to install account_authz from.
|
|
24
|
+
- RubyGems: `gem "account_authz"`
|
|
25
|
+
- Git: `gem "account_authz", github: "DYB-Development/account_authz", branch: "main"`
|
|
26
|
+
|
|
27
|
+
Add the chosen line to `Gemfile`, then run `bundle install`. This updates `Gemfile.lock`.
|
|
28
|
+
3. Run `bin/rails account_authz:install:migrations`. It copies three files into `db/migrate/`, named `<timestamp>_create_account_authz_roles.account_authz.rb`, `<timestamp>_create_account_authz_assignments.account_authz.rb` and `<timestamp>_add_rank_to_account_authz_roles.account_authz.rb`.
|
|
29
|
+
- `account_authz_roles` has `account_id` (bigint, required, indexed), `name` (string, required), `capabilities` (json, default empty array), and `rank` (integer, required, default 0).
|
|
30
|
+
- `account_authz_assignments` has a polymorphic `member` reference, a `role` reference, and a unique index on member and role together.
|
|
31
|
+
- Neither table has a foreign key to an accounts table, so the host needs no account model for the migrations to run.
|
|
32
|
+
- AccountAuthz stores no invitations of its own, so no table is copied for them.
|
|
33
|
+
4. Open the three copied files. They declare `ActiveRecord::Migration[8.1]`. If the host runs a Rails version older than 8.1, change `[8.1]` in all three files to the host's Rails version, such as `[7.2]`.
|
|
34
|
+
5. Run `bin/rails db:migrate`. This updates `db/schema.rb` or `db/structure.sql`.
|
|
35
|
+
6. Choose the model that holds roles. A role belongs to one account, so the model to include `AccountAuthz::Member` in is the record for a person inside one account, such as `Membership`, not the person record, such as `User`.
|
|
36
|
+
- Look in `app/models/` for a model that joins a person to an account. If there is one, confirm with the developer that it is the record to use.
|
|
37
|
+
- If there is none, tell the developer that roles can be held by the person record instead, and ask whether to use it or to add a membership model first. With the person record, a check made from a controller, a view or a policy counts only the current account's roles, and a check made anywhere else must name the account or it counts the person's roles in every account.
|
|
38
|
+
- Add `include AccountAuthz::Member` to the chosen model's file in `app/models/`. Any Active Record model works, because the assignment is polymorphic. Destroying a member record destroys its role assignments, so with a membership model, a person's roles in an account go when their membership in it goes.
|
|
39
|
+
7. Add `include AccountAuthz::Authorization` to `app/controllers/application_controller.rb`. If the controller already includes `Pundit::Authorization`, leave that line in place.
|
|
40
|
+
8. `AccountAuthz::Authorization` calls `current_member` on the controller, and its `can?` helper returns `false` when that returns `nil`. Check whether `ApplicationController` already defines `current_member`. If it does not, ask the developer how the member record for the signed-in request is found, and define `current_member` in `ApplicationController` to return that record. With a membership model, that is the signed-in person's membership in the current account from step 10, so `current_member` must look it up after the current account is set.
|
|
41
|
+
9. Pundit passes `pundit_user` to every policy, and `pundit_user` returns `current_user` unless the host overrides it. If the model from step 6 is not the model `current_user` returns, define `pundit_user` in `ApplicationController` to return `current_member`.
|
|
42
|
+
10. Ask the developer how the current account is found for a request, such as from the subdomain, the signed-in user, or a URL parameter. Add a `before_action` to `ApplicationController` that sets `AccountAuthz::Current.account_id` to that account's integer id. Rails resets it at the end of every request.
|
|
43
|
+
11. Ask the developer whether they want account_authz's pages. The one mount serves both the members page and the role pages, so the host gets both or neither. If they do not want them, skip this step and steps 12 and 13. If they do, ask which path to serve them under, offering `/account_authz`, and add `mount AccountAuthz::Engine => "/account_authz"` with that path to `config/routes.rb`. The members page is then at that path followed by `/members`, and the roles page at that path followed by `/roles`.
|
|
44
|
+
- The engine's controllers inherit the host's `ApplicationController`, so the sign-in, `current_member`, current account and CSRF protection from the host apply to every page and every form on them.
|
|
45
|
+
- The pages render inside the layout the host's `ApplicationController` uses, such as `app/views/layouts/application.html.erb`. Route helpers in that layout, such as `root_path`, reach the host's own routes on the pages without a `main_app.` prefix, so the layout needs no change for them.
|
|
46
|
+
- The pages are built from keystone_ui components and ship no stylesheet of their own, so that layout must load keystone_ui's styles. Check whether the host already loads them. If it does not and the host has a keystone_ui install local, hand that step to it. Otherwise ask the developer how the host loads keystone_ui's styles before continuing.
|
|
47
|
+
- A change a manager may not make sends them back to a page with a flash alert saying why, and the engine's pages do not show flash messages themselves. Check whether that layout renders `flash[:alert]`. If it does not, tell the developer that refused changes will return to the page with no message, and ask where in the layout to render the alert.
|
|
48
|
+
- The members page shows a `Roles` link only to a viewer who holds the roles capability in the current account, and the roles page shows a `Members` link to every viewer. A member who holds the roles capability but not the members capability gets a 403 response on the members page, so that member reaches the roles page only through a link straight to it. Ask the developer whether the host's navigation should link to the members page, the roles page, or both, and where to put each link.
|
|
49
|
+
- A request with no current account gets a 403 response on every page and every form.
|
|
50
|
+
12. Check the members page against these facts, and tell the developer about any that the host does not meet.
|
|
51
|
+
- A member who does not hold the members capability in the current account gets a 403 response, whether they load the page, give or take a role, invite a person, send an invitation again, cancel one, or remove a member. The capability is `manage_members` unless the develop local changes it.
|
|
52
|
+
- Every member record the page lists must respond to `name` and `email` and include `AccountAuthz::Member`. If the model from step 6 lacks `name` or `email`, as a membership model often does, ask the developer how it should answer them, such as from the person record it belongs to, before continuing.
|
|
53
|
+
- Every waiting invitation the page lists must respond to `name` and `email`, and must be findable by its id among the current account's invitations. It needs no account_authz concern and no account_authz table.
|
|
54
|
+
- The engine sends no email and stores no invitation. Inviting a person, sending an invitation again, and cancelling one each call the host's own code, and accepting an invitation is the host's own flow.
|
|
55
|
+
- The invite form has a required `Name` field, a required `Email` field and an `Invite` button, and the engine does not validate either value, so the host's invite decides what to do with one it rejects.
|
|
56
|
+
- Giving or taking a role, removing a member, sending an invitation again and cancelling one find the record only among the current account's members, roles or invitations, so a record from another account raises a not-found error, which Rails answers with a 404 response outside development.
|
|
57
|
+
- A refused give, take or removal changes nothing and returns to the members page with a flash alert naming the reason, drawn from these four: `You can only give or take roles ranked below your own.`, `You can only change members ranked below you.`, `Someone else needs to be able to manage members first.` and `This member can't be removed from the account.`
|
|
58
|
+
- Sending an invitation again and cancelling one are not limited by rank, so every viewer who holds the members capability may do both to every waiting invitation.
|
|
59
|
+
- The account always keeps at least one member who holds the members capability, so a `Take <role>` or `Remove` button is left out when that member is the only way anyone in the current account holds it.
|
|
60
|
+
- Every role starts at rank 0, so until ranks are set, every viewer who holds a role reaches every member and every role. Tell the developer this, and that a role's rank is set on the role form.
|
|
61
|
+
- Removing a member takes away every role they hold in the current account and then calls the host's remove, both in one database transaction.
|
|
62
|
+
- The page does not know which records to list, which invitations are waiting, how to invite a person, how to send an invitation again, how to cancel one, which members cannot be removed, or how to remove one until the develop local configures that. Until then, a request from a member who holds the members capability raises an error on the page, on every button and on the invite form.
|
|
63
|
+
13. Check the role pages against these facts, and tell the developer about any that the host does not meet.
|
|
64
|
+
- A member who does not hold the roles capability in the current account gets a 403 response on every role page and form. The capability is `manage_roles` unless the develop local changes it.
|
|
65
|
+
- The roles page lists each role in the current account by name with its number of capabilities, and each name links to that role's edit form. A `New role` link opens the form for a new role.
|
|
66
|
+
- The new and edit forms take a name, a rank as a number field with a minimum of 0, and a checkbox for each capability in the catalog, and saving returns to the roles page. Until the develop local declares the catalog, the forms show no checkboxes.
|
|
67
|
+
- The roles page shows an `Add <template>` button for each default template, which creates that role in the current account at rank 0. The section is left out until the develop local declares a default template.
|
|
68
|
+
- A refused create or save changes nothing and returns to the form or the roles page with a flash alert naming the reason, drawn from these four: `You can only change roles ranked below your own.`, `You can only set a rank up to your own.`, `You can only give a role capabilities you have yourself.` and `Someone else needs to be able to manage members first.`
|
|
69
|
+
- Editing a role finds it only among the current account's roles, so a role from another account raises a not-found error, which Rails answers with a 404 response outside development.
|
|
70
|
+
- Saving a role with a blank name raises a validation error, which Rails answers with a 422 response outside development.
|
|
71
|
+
|
|
72
|
+
## Conventions
|
|
73
|
+
- After step 5, confirm the schema file contains both `account_authz_roles` and `account_authz_assignments`, and that `account_authz_roles` has a `rank` column.
|
|
74
|
+
- After step 10, confirm the host boots with `bin/rails runner 'puts AccountAuthz::Current.account_id.inspect'`, which prints `nil` outside a request.
|
|
75
|
+
- After step 11, confirm `bin/rails routes` lists the mount and, under the routes for `AccountAuthz::Engine`, a `GET` route for `members`, a `DELETE` route for `members/:id`, a `POST` route for `members/:member_id/roles`, a `DELETE` route for `members/:member_id/roles/:id`, a `POST` route for `invitations`, a `POST` route for `invitations/:id/resend`, a `DELETE` route for `invitations/:id`, `GET` routes for `roles`, `roles/new` and `roles/:id/edit`, a `POST` route for `roles`, and `PATCH` and `PUT` routes for `roles/:id`.
|
|
76
|
+
- After step 12, once the develop local has configured the members page, load it as a member who holds the members capability and confirm it shows the invite form and any waiting invitations inside the host's layout with keystone_ui's styles applied.
|
|
77
|
+
- After step 13, load the roles page as a member who holds the roles capability and confirm it shows inside the host's layout with keystone_ui's styles applied.
|
|
78
|
+
- After updating the account_authz gem, run `bin/rails account_authz:install:migrations` again, then `bin/rails db:migrate`. The task copies only migrations the host does not already have. A host that installed account_authz before ranks existed gets the rank migration this way, and every existing role gets rank 0.
|
|
79
|
+
- Declaring capabilities, declaring templates, seeding roles for a new account, giving the first member the members or roles capability, writing policies, checking reach in host code, checking in host code whether a change would leave the account with no member who holds the members capability, configuring which members and which waiting invitations the members page lists, how it invites a person, sends an invitation again and cancels one, which members cannot be removed and how it removes one, configuring which capabilities open the pages, and rewording the refusal messages are out of scope for this local. Hand that work to the account_authz-develop local.
|
|
80
|
+
- The members page and the role pages are the only screens account_authz adds. Deleting a role is not offered on them, and a screen for it belongs to the host. Sending an invitation and accepting one also belong to the host.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
scope: authorization — capability catalog, roles, and Pundit enforcement in multi-tenant Rails apps
|
|
2
|
+
|
|
3
|
+
install:
|
|
4
|
+
- gem "account_authz"
|
|
5
|
+
- bin/rails account_authz:install:migrations
|
|
6
|
+
- AccountAuthz::Member
|
|
7
|
+
- AccountAuthz::Authorization
|
|
8
|
+
- AccountAuthz::Current.account_id
|
|
9
|
+
- mount AccountAuthz::Engine
|
|
10
|
+
|
|
11
|
+
develop:
|
|
12
|
+
- AccountAuthz.catalog
|
|
13
|
+
- AccountAuthz.catalog.permissions
|
|
14
|
+
- AccountAuthz.catalog.metrics
|
|
15
|
+
- AccountAuthz.capabilities
|
|
16
|
+
- AccountAuthz.reset!
|
|
17
|
+
- AccountAuthz.can?
|
|
18
|
+
- AccountAuthz.approved_metrics
|
|
19
|
+
- AccountAuthz::Role.in_account
|
|
20
|
+
- AccountAuthz::Role.create!
|
|
21
|
+
- AccountAuthz::Role.from_template
|
|
22
|
+
- AccountAuthz.templates
|
|
23
|
+
- AccountAuthz.templates.find
|
|
24
|
+
- AccountAuthz.templates.defaults
|
|
25
|
+
- AccountAuthz.seed_default_roles
|
|
26
|
+
- member.assign_role
|
|
27
|
+
- member.revoke_role
|
|
28
|
+
- member.account_authz_roles
|
|
29
|
+
- member.capabilities
|
|
30
|
+
- member.can?
|
|
31
|
+
- member.approved_metrics
|
|
32
|
+
- AccountAuthz::ApplicationPolicy
|
|
33
|
+
- AccountAuthz.members_source
|
|
34
|
+
- AccountAuthz.members_capability
|
|
35
|
+
- AccountAuthz.roles_capability
|
|
36
|
+
- AccountAuthz::Reach
|
|
37
|
+
- reach.includes_member?
|
|
38
|
+
- reach.includes_role?
|
|
39
|
+
- reach.includes_capabilities?
|
|
40
|
+
- reach.includes_rank?
|
|
41
|
+
- AccountAuthz::LastManager
|
|
42
|
+
- account_authz.refusals
|
|
43
|
+
- last_manager.lost_by_taking?
|
|
44
|
+
- last_manager.lost_by_removing?
|
|
45
|
+
- last_manager.lost_by_changing?
|
|
46
|
+
|
|
47
|
+
sources:
|
|
48
|
+
- lib/account_authz.rb
|
|
49
|
+
- lib/account_authz/catalog.rb
|
|
50
|
+
- lib/account_authz/templates.rb
|
|
51
|
+
- lib/account_authz/engine.rb
|
|
52
|
+
- config/routes.rb
|
|
53
|
+
- app/controllers/account_authz/members_controller.rb
|
|
54
|
+
- app/controllers/account_authz/invitations_controller.rb
|
|
55
|
+
- test/dummy/app/models/member_directory.rb
|
|
56
|
+
- app/controllers/account_authz/member_roles_controller.rb
|
|
57
|
+
- app/views/account_authz/members/index.html.erb
|
|
58
|
+
- app/controllers/account_authz/roles_controller.rb
|
|
59
|
+
- app/models/account_authz/reach.rb
|
|
60
|
+
- app/models/account_authz/last_manager.rb
|
|
61
|
+
- config/locales/en.yml
|
|
62
|
+
- app/views/account_authz/roles/index.html.erb
|
|
63
|
+
- app/views/account_authz/roles/_form.html.erb
|
|
64
|
+
- app/controllers/account_authz/application_controller.rb
|
|
65
|
+
- app/helpers/account_authz/app_routes_helper.rb
|
|
66
|
+
- lib/account_authz/reference/guide.md
|
|
67
|
+
- app/models/account_authz/role.rb
|
|
68
|
+
- app/models/account_authz/current.rb
|
|
69
|
+
- app/models/concerns/account_authz/member.rb
|
|
70
|
+
- app/controllers/concerns/account_authz/authorization.rb
|
|
71
|
+
- app/policies/account_authz/application_policy.rb
|
metadata
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: account_authz
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- tylercschneider
|
|
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: json
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "<"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '3'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "<"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '3'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: rails
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '7.1'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '7.1'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: pundit
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '2.0'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '2.0'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: keystone_ui
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0.9'
|
|
61
|
+
type: :runtime
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - ">="
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '0.9'
|
|
68
|
+
description: AccountAuthz is the authorization layer for multi-tenant apps. The app
|
|
69
|
+
declares a fixed catalog of capabilities (permission + metric keys) in code; accounts
|
|
70
|
+
manage roles as data that bundle those capabilities; AccountAuthz resolves what
|
|
71
|
+
a member may do (can?) and which metrics they may see (approved_metrics) from their
|
|
72
|
+
roles, and plugs into Pundit for enforcement.
|
|
73
|
+
email:
|
|
74
|
+
- tylercschneider@gmail.com
|
|
75
|
+
executables: []
|
|
76
|
+
extensions: []
|
|
77
|
+
extra_rdoc_files: []
|
|
78
|
+
files:
|
|
79
|
+
- LICENSE.txt
|
|
80
|
+
- README.md
|
|
81
|
+
- Rakefile
|
|
82
|
+
- app/controllers/account_authz/application_controller.rb
|
|
83
|
+
- app/controllers/account_authz/invitations_controller.rb
|
|
84
|
+
- app/controllers/account_authz/member_roles_controller.rb
|
|
85
|
+
- app/controllers/account_authz/members_controller.rb
|
|
86
|
+
- app/controllers/account_authz/roles_controller.rb
|
|
87
|
+
- app/controllers/concerns/account_authz/authorization.rb
|
|
88
|
+
- app/helpers/account_authz/app_routes_helper.rb
|
|
89
|
+
- app/helpers/account_authz/application_helper.rb
|
|
90
|
+
- app/models/account_authz/account_id.rb
|
|
91
|
+
- app/models/account_authz/acting_member.rb
|
|
92
|
+
- app/models/account_authz/application_record.rb
|
|
93
|
+
- app/models/account_authz/assignment.rb
|
|
94
|
+
- app/models/account_authz/cancel_invitation.rb
|
|
95
|
+
- app/models/account_authz/current.rb
|
|
96
|
+
- app/models/account_authz/give_role.rb
|
|
97
|
+
- app/models/account_authz/invite.rb
|
|
98
|
+
- app/models/account_authz/last_manager.rb
|
|
99
|
+
- app/models/account_authz/reach.rb
|
|
100
|
+
- app/models/account_authz/remove_member.rb
|
|
101
|
+
- app/models/account_authz/resend_invitation.rb
|
|
102
|
+
- app/models/account_authz/result.rb
|
|
103
|
+
- app/models/account_authz/role.rb
|
|
104
|
+
- app/models/account_authz/take_role.rb
|
|
105
|
+
- app/models/concerns/account_authz/member.rb
|
|
106
|
+
- app/policies/account_authz/application_policy.rb
|
|
107
|
+
- app/views/account_authz/invitations/new.html.erb
|
|
108
|
+
- app/views/account_authz/members/_team.html.erb
|
|
109
|
+
- app/views/account_authz/members/index.html.erb
|
|
110
|
+
- app/views/account_authz/members/show.html.erb
|
|
111
|
+
- app/views/account_authz/roles/_form.html.erb
|
|
112
|
+
- app/views/account_authz/roles/edit.html.erb
|
|
113
|
+
- app/views/account_authz/roles/index.html.erb
|
|
114
|
+
- app/views/account_authz/roles/new.html.erb
|
|
115
|
+
- config/locales/en.yml
|
|
116
|
+
- config/routes.rb
|
|
117
|
+
- db/migrate/20260607000001_create_citizen_roles.rb
|
|
118
|
+
- db/migrate/20260607000002_create_citizen_assignments.rb
|
|
119
|
+
- db/migrate/20260916000001_add_rank_to_citizen_roles.rb
|
|
120
|
+
- db/migrate/20260921220000_rename_citizen_tables_to_account_authz.rb
|
|
121
|
+
- lib/account_authz.rb
|
|
122
|
+
- lib/account_authz/catalog.rb
|
|
123
|
+
- lib/account_authz/engine.rb
|
|
124
|
+
- lib/account_authz/reference.rb
|
|
125
|
+
- lib/account_authz/reference/guide.md
|
|
126
|
+
- lib/account_authz/templates.rb
|
|
127
|
+
- lib/account_authz/version.rb
|
|
128
|
+
- lib/tasks/account_authz_tasks.rake
|
|
129
|
+
- the_local/agents/account_authz-develop.md
|
|
130
|
+
- the_local/agents/account_authz-info.md
|
|
131
|
+
- the_local/agents/account_authz-install.md
|
|
132
|
+
- the_local/interface.yml
|
|
133
|
+
homepage: https://github.com/DYB-Development/account_authz
|
|
134
|
+
licenses:
|
|
135
|
+
- MIT
|
|
136
|
+
metadata:
|
|
137
|
+
allowed_push_host: https://rubygems.org
|
|
138
|
+
homepage_uri: https://github.com/DYB-Development/account_authz
|
|
139
|
+
source_code_uri: https://github.com/DYB-Development/account_authz
|
|
140
|
+
changelog_uri: https://github.com/DYB-Development/account_authz/blob/main/CHANGELOG.md
|
|
141
|
+
bug_tracker_uri: https://github.com/DYB-Development/account_authz/issues
|
|
142
|
+
rubygems_mfa_required: 'true'
|
|
143
|
+
rdoc_options: []
|
|
144
|
+
require_paths:
|
|
145
|
+
- lib
|
|
146
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
147
|
+
requirements:
|
|
148
|
+
- - ">="
|
|
149
|
+
- !ruby/object:Gem::Version
|
|
150
|
+
version: 3.2.0
|
|
151
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
|
+
requirements:
|
|
153
|
+
- - ">="
|
|
154
|
+
- !ruby/object:Gem::Version
|
|
155
|
+
version: '0'
|
|
156
|
+
requirements: []
|
|
157
|
+
rubygems_version: 4.0.20
|
|
158
|
+
specification_version: 4
|
|
159
|
+
summary: 'Capability-based authorization: roles grant capabilities, Pundit enforces'
|
|
160
|
+
test_files: []
|