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/_user.html.erb | |
| 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/_user.html.erb')
| -rw-r--r-- | app/views/users/_user.html.erb | 17 |
1 files changed, 17 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 %> |
