diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-31 17:05:05 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-31 17:05:05 +0200 |
| commit | 8c6a6516e1dc5c1b4f12740a6f7b32765b530bb7 (patch) | |
| tree | e40a1da656bedef0662f0e984b4e3b00b374bc1d /app/helpers | |
| parent | 464dd4266bdc433805010b5dca428f4cb75c2a81 (diff) | |
Replace user deletion with deactivation
Deactivation adds the alumni role and leaves the others in place, so
reactivation is lossless and nobody has to remember what an account held.
login_from_session checks alumni? on every request, so a signed-in user is
locked out on their next one without any session invalidation. Guards
prevent deactivating yourself or the last active admin, and both verbs are
witnessed in the action log.
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/node_actions_helper.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/helpers/node_actions_helper.rb b/app/helpers/node_actions_helper.rb index 4cbe741c..f57ef84f 100644 --- a/app/helpers/node_actions_helper.rb +++ b/app/helpers/node_actions_helper.rb | |||
| @@ -18,7 +18,9 @@ module NodeActionsHelper | |||
| 18 | "asset_destroy" => "file-x", | 18 | "asset_destroy" => "file-x", |
| 19 | "otp_enroll" => "shield-lock", | 19 | "otp_enroll" => "shield-lock", |
| 20 | "otp_disable" => "shield-off", | 20 | "otp_disable" => "shield-off", |
| 21 | "otp_reset" => "shield-x" | 21 | "otp_reset" => "shield-x", |
| 22 | "user_deactivate" => "user-off", | ||
| 23 | "user_reactivate" => "user-check" | ||
| 22 | }.freeze | 24 | }.freeze |
| 23 | 25 | ||
| 24 | def verb_icon action | 26 | def verb_icon action |
| @@ -271,4 +273,14 @@ module NodeActionsHelper | |||
| 271 | t("node_actions.otp_reset", :actor => actor_ref(action), | 273 | t("node_actions.otp_reset", :actor => actor_ref(action), |
| 272 | :target => user_participant_ref(action)).html_safe | 274 | :target => user_participant_ref(action)).html_safe |
| 273 | end | 275 | end |
| 276 | |||
| 277 | def summarize_user_deactivate action | ||
| 278 | t("node_actions.user_deactivate", :actor => actor_ref(action), | ||
| 279 | :target => user_participant_ref(action)).html_safe | ||
| 280 | end | ||
| 281 | |||
| 282 | def summarize_user_reactivate action | ||
| 283 | t("node_actions.user_reactivate", :actor => actor_ref(action), | ||
| 284 | :target => user_participant_ref(action)).html_safe | ||
| 285 | end | ||
| 274 | end | 286 | end |
