mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
Records package viewer: read-only, no account needed
SAM_VIEWER=true (set only by the records package's viewer/docker-compose.yml) makes the app a read-only copy of an archive, for whoever receives the records: `docker compose up`, then open http://localhost:3000. - At start (bin/docker-entrypoint → sam:viewer:prepare) the package's .sam.zip, mounted read-only, is imported once. - No sign-in: everyone browses as a built-in account. Nothing can be changed: any request but GET/HEAD is refused, no role permission applies (so no edit buttons), and there's no sign-out or profile. A banner names the archive and when it was exported. - It refuses to start, and every page answers 503, when the database has any other account, so turning it on for a real installation stops the app instead of exposing its records. - The viewer listens on 127.0.0.1 only, and skips scheduled jobs (reminders, backups, AD searches). - Docs: the package README (three steps now), Access & sharing, README settings and features, the suggested recordkeeping procedures. Checked end to end with a built image and a real records package: the archive imported at start, pages browsed without an account, a change refused, and the container refusing to start once an account existed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
34e3232350
commit
d956cfbe83
14 files changed
+229
-33
No files matched your search
+2
-1
@@ -123,10 +123,11 @@ class User < ApplicationRecord
|
||||
|
||||
# Adding an aircraft (or importing one) makes you its Owner: administrators,
|
||||
# or everyone when Admin → Settings allows it.
|
||||
def can_add_aircraft? = admin? || Setting.anyone_adds_aircraft?
|
||||
def can_add_aircraft? = !Viewer.enabled? && (admin? || Setting.anyone_adds_aircraft?)
|
||||
|
||||
# Administrators can do everything on every aircraft.
|
||||
def can?(permission, aircraft)
|
||||
return false if Viewer.enabled?
|
||||
admin? || role_for(aircraft)&.can?(permission) || false
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user