diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-08-01 00:27:34 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-08-01 00:27:34 +0200 |
| commit | 8bcacace28df52fd972c54e6850aa3b93f5c8bdf (patch) | |
| tree | 05e90dd4e8f31ebb142f66239025da15e873901f /app/controllers/menu_items_controller.rb | |
| parent | 529f81b28ed77c62acaa63fad957e751798f2440 (diff) | |
Declare role requirements per controller
RoleRequired supplies require_redaktion and require_admin for surfaces that
are not nodes and so cannot be reached by Node#restricted?.
Navigation is content rather than plumbing, so menu_items requires
redaktion. User management is janitorial and requires admin: index, new,
create, reset_otp, deactivate, reactivate. verify_status now also covers
show, without which any logged-in user could read any account by walking a
small id space. Editing your own account stays open.
The dashboard hides the Users and Navigation buttons from those who cannot
use them; everything else stays visible to everyone. Both denials share one
message and land on the dashboard.
Adds redella (redaktion) and alufa (redaktion + alumni) fixtures.
Diffstat (limited to 'app/controllers/menu_items_controller.rb')
| -rw-r--r-- | app/controllers/menu_items_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/menu_items_controller.rb b/app/controllers/menu_items_controller.rb index f169e0ca..63935f13 100644 --- a/app/controllers/menu_items_controller.rb +++ b/app/controllers/menu_items_controller.rb | |||
| @@ -1,9 +1,11 @@ | |||
| 1 | class MenuItemsController < ApplicationController | 1 | class MenuItemsController < ApplicationController |
| 2 | include PinnedToDefaultLocale | 2 | include PinnedToDefaultLocale |
| 3 | include RoleRequired | ||
| 3 | 4 | ||
| 4 | # Private | 5 | # Private |
| 5 | 6 | ||
| 6 | before_action :login_required | 7 | before_action :login_required |
| 8 | before_action :require_redaktion | ||
| 7 | 9 | ||
| 8 | layout 'admin' | 10 | layout 'admin' |
| 9 | 11 | ||
