diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-31 14:35:16 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-31 14:35:16 +0200 |
| commit | 5f17f421b176d48ef556fb379f59bbb7d284b48e (patch) | |
| tree | 15f07f480b07c385c88d43f827fc452b5b9df21a /db | |
| parent | a90a77cfb913c7c0444ec793b47fd4be6fb66c9f (diff) | |
Retire the unused per-node permission subsystem
Every path through Permission raised or lied: validates_presence_of on a
boolean made granted = false unsaveable, since false.blank? is true;
get_permission_for read a nonexistent identifier attribute; has_permission?
called an undefined plural method and returned a truthy relation in every
case; and set_permission mutated granted without saving. Nothing outside the
model referenced it and the table was empty.
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20260731123346_drop_permissions.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20260731123346_drop_permissions.rb b/db/migrate/20260731123346_drop_permissions.rb new file mode 100644 index 00000000..6ea7d2f0 --- /dev/null +++ b/db/migrate/20260731123346_drop_permissions.rb | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | class DropPermissions < ActiveRecord::Migration[8.1] | ||
| 2 | def up | ||
| 3 | drop_table :permissions | ||
| 4 | end | ||
| 5 | |||
| 6 | # Reversible for form's sake -- the table was empty and every write path | ||
| 7 | # in the model was broken, so there is nothing to restore. | ||
| 8 | def down | ||
| 9 | create_table :permissions, :id => :serial do |t| | ||
| 10 | t.boolean :granted | ||
| 11 | t.integer :node_id | ||
| 12 | t.integer :user_id | ||
| 13 | t.datetime :created_at, :precision => nil | ||
| 14 | t.datetime :updated_at, :precision => nil | ||
| 15 | end | ||
| 16 | end | ||
| 17 | end | ||
