From 8c6a6516e1dc5c1b4f12740a6f7b32765b530bb7 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 31 Jul 2026 17:05:05 +0200 Subject: 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. --- app/helpers/node_actions_helper.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'app/helpers') 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 "asset_destroy" => "file-x", "otp_enroll" => "shield-lock", "otp_disable" => "shield-off", - "otp_reset" => "shield-x" + "otp_reset" => "shield-x", + "user_deactivate" => "user-off", + "user_reactivate" => "user-check" }.freeze def verb_icon action @@ -271,4 +273,14 @@ module NodeActionsHelper t("node_actions.otp_reset", :actor => actor_ref(action), :target => user_participant_ref(action)).html_safe end + + def summarize_user_deactivate action + t("node_actions.user_deactivate", :actor => actor_ref(action), + :target => user_participant_ref(action)).html_safe + end + + def summarize_user_reactivate action + t("node_actions.user_reactivate", :actor => actor_ref(action), + :target => user_participant_ref(action)).html_safe + end end -- cgit v1.3