mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
Invitation codes: a link that gives an account and roles
Ported from the original (InvitationCode), adapted to configurable roles. - Admin → Invitations: a label, optionally one email address (only it can use the link, and it's emailed) and a name, how many uses (or unlimited), an expiry (or never), and a role on any aircraft (or none, for an account only). - An aircraft's Access page: whoever manages its people invites to that aircraft, with only the roles they can give; they see and revoke its invitations. - /join/<code>: shows what it gives; create an account (when password sign-in is on) or sign in, then accept. Existing accounts and SSO users accept too. A role someone already has on an aircraft stays. - Roles are given as the invitation's creator (AircraftAccess), and only while they can still manage that aircraft's people. Codes are kept as digests and shown once; uses are counted under a lock; account creation and accepting are rate-limited; any invalid link gets the same answer. - Docs: guide (Administration, Access & sharing), README, and why /join isn't on the Authentik bypass list. The README's not-yet-ported list now names Prometheus metrics, and no longer claims oil analysis import as new. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a645778f26
commit
b4c7aaa3ff
34 files changed
+822
-7
No files matched your search
@@ -0,0 +1,4 @@
|
||||
<p><%= t(".invites_you_html", who: (@invitation.created_by&.display_name || t(".an_administrator"))) %></p>
|
||||
<% if @grants.any? %><ul><% @grants.each do |g| %><li><strong><%= g.aircraft.tail_number %></strong>: <%= g.role.name %></li><% end %></ul><% end %>
|
||||
<p><%= link_to t(".accept_the_invitation"), @url %></p>
|
||||
<% if @invitation.expires_at %><p style="color:#64748b;font-size:12px"><%= t(".expires_html", date: fmt_date(@invitation.expires_at.to_date)) %></p><% end %>
|
||||
@@ -0,0 +1,11 @@
|
||||
<%= raw t(".invites_you_text", who: (@invitation.created_by&.display_name || t(".an_administrator"))) %>
|
||||
<% @grants.each do |g| %>
|
||||
- <%= g.aircraft.tail_number %>: <%= g.role.name %>
|
||||
<% end %>
|
||||
|
||||
<%= raw t(".open_the_link_text") %>
|
||||
<%= @url %>
|
||||
<% if @invitation.expires_at %>
|
||||
|
||||
<%= raw t(".expires_text", date: fmt_date(@invitation.expires_at.to_date)) %>
|
||||
<% end %>
|
||||
Reference in new issue
Block a user