diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-08-01 04:14:00 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-08-01 04:14:00 +0200 |
| commit | abd7ee1fc2ecc15b50944db30c59bedc26ec41b6 (patch) | |
| tree | 821bb8ca610664c57d9065bf62285166243500a4 /app/views/users | |
| parent | 6df48c1413a14516e7ee8919f33fbc13f0141966 (diff) | |
Let Redaktion grant and revoke its own role
Any holder may add or remove another account, witnessed as
redaktion_grant/revoke so the vouching is legible. Not behind elevation:
onboarding must not wait for a keyholder, and a compromised Redaktion
account can already publish.
Diffstat (limited to 'app/views/users')
| -rw-r--r-- | app/views/users/_user.html.erb | 17 | ||||
| -rw-r--r-- | app/views/users/index.html.erb | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb index ff9d4e37..ba82375d 100644 --- a/app/views/users/_user.html.erb +++ b/app/views/users/_user.html.erb | |||
| @@ -26,5 +26,22 @@ | |||
| 26 | <% end %> | 26 | <% end %> |
| 27 | <% end %> | 27 | <% end %> |
| 28 | </td> | 28 | </td> |
| 29 | <td> | ||
| 30 | <% if current_user.redaktion? && !user.alumni? %> | ||
| 31 | <% if user.redaktion? %> | ||
| 32 | <% unless user == current_user %> | ||
| 33 | <%= button_to t(".revoke_redaktion"), revoke_redaktion_user_path(user), method: :put, | ||
| 34 | form: { data: { confirm: t(".confirm_revoke_redaktion", :login => user.login) }, | ||
| 35 | class: 'button_to destructive' } %> | ||
| 36 | <% end %> | ||
| 37 | <% elsif user.otp_enrolled? %> | ||
| 38 | <%= button_to t(".grant_redaktion"), grant_redaktion_user_path(user), method: :put, | ||
| 39 | form: { data: { confirm: t(".confirm_grant_redaktion", :login => user.login) }, | ||
| 40 | class: 'button_to state_changing' } %> | ||
| 41 | <% else %> | ||
| 42 | <span class="field_hint"><%= t(".needs_otp") %></span> | ||
| 43 | <% end %> | ||
| 44 | <% end %> | ||
| 45 | </td> | ||
| 29 | </tr> | 46 | </tr> |
| 30 | <% end %> | 47 | <% end %> |
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 854811a2..2936bbea 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | <% end %> | 8 | <% end %> |
| 9 | <% end %> | 9 | <% end %> |
| 10 | </p> | 10 | </p> |
| 11 | <p class="field_hint"><%= t(".admin_hint") %></p> | ||
| 11 | 12 | ||
| 12 | <% UsersController::GROUP_ORDER.each do |group| %> | 13 | <% UsersController::GROUP_ORDER.each do |group| %> |
| 13 | <% members = @users[group] || [] %> | 14 | <% members = @users[group] || [] %> |
