QA #313
未完了ユーザーの誤削除を絶対にさせない
0%
説明
■現象/要望¶
Redmine上で、ユーザーの誤削除を絶対にできない様にしたい。
誤ってユーザーを削除した場合、DBのバックアップでも無いと復旧は困難。
ユーザIDのロックで使用不能になるのだから、削除は最初から出来なくて良いと思う。
削除で浮くデータサイズは微々たる量だし、復旧の手間の方が無駄。
■解決策¶
下記4案有
0.Redmine本家-ユーザーとプロジェクトの誤削除防止対策
.
Redmine 4.2 / RedMica 1.3より、ユーザーとプロジェクトの誤削除防止対策が組み込まれます。
ユーザー削除のときはログインID、プロジェクト削除のときはプロジェクト識別子の入力が確認画面で必要になります。
https://redmine.tokyo/issues/313#note-12
1. Redmineのソース改変
app/model/users.rb
class User < Principal の中に、下記コードを追加して再起動する。
# Prohibit deletion of users def destroy false end
これにより
・ユーザ削除ボタンを押しても削除されない。
・ユーザロックはできる。
2.View Customize Plugin でユーザー管理画面の「削除」ボタンを非表示化
(ソース変更不要・再起動不要)
/*
Path pattern: /users
Type: css
ユーザー管理画面で削除ボタンを非表示に
*/
.icon-del{
display:none;
}
「削除」を非表示、adminのみ削除可能(viewcustomize)
https://qiita.com/aj15_aj15/items/2edfac149fe0944ac556
3.Redmine本体の機能追加(案)
sudo_mode みたいに coniguration.yml で有効・無効化
http://www.redmine.org/issues/6751
■対応状況¶
0.ユーザーとプロジェクトの誤削除防止対策組込(Redmine 4.2 / RedMica 1.3)
https://www.redmine.org/issues/34417
↓動作確認済
1.ソース改竄による対応
2.ユーザ管理画面の削除非表示(ViewCustomize利用)
■補足¶
削除機能は1.2.0で追加された。
SPAM登録が蔓延る環境ではユーザ削除機能が必要。
http://www.redmine.org/issues/7296
https://redmine.tokyo/issues/313#note-6
ファイル
奈良 裕記 さんが約7年前に更新
ユーザ削除時に、
models/user.rbの
before_destroy :remove_references_before_destroy after_destroy :deliver_security_notification ..... # Removes references that are not handled by associations # Things that are not deleted are reassociated with the anonymous user def remove_references_before_destroy
も実行されます。
過去のデータはanonymous扱いになるので、confidentialなデータがあると不味そう。
変更経緯を追えなくなりますので、自分はロック一択です。
CALコスト削減等で、退職者を削除したい場合もあるでしょうが、
Redmineのユーザ数単位有料ソフトだとロックしたユーザID分はカウントしないものが多いかな?
(某プラグインはそう聞いたことがあります)
前田 剛 さんが約7年前に更新
もともとユーザーの削除機能は無かったのですが、要望が多く1.2.0で追加されました。
http://www.redmine.org/issues/7296
機能を消したら消したで反対意見が多く寄せられるのではないかと思います。一度追加した機能を消すのは大変です。
奈良 裕記 さんが約7年前に更新
何事も過去の背景は知っておくべきですね。
SPAM蔓延る環境だとdelete必須というのは理解できます。
自分の環境では考える必要ありませんが。
6751に+1してきます。
Advanced user administration
http://www.redmine.org/issues/6751
It would be nice if there were better ways to deal with deprecated/old/spam users, instead of just activating/locking them.
..
However, some organisations may want to keep a log of everything (prevent deletion).
In that case, this can perhaps be an option that only an Administrator can set.
Delete Users and automatically ticket change
http://www.redmine.org/issues/1572
1) In order to free the username for other users administrators should be allowed to find inactive users and delete them.
Allow deletion of Pending User, not yet activated
http://www.redmine.org/issues/3433
Accepting new users
http://www.redmine.org/boards/2/topics/5649
前田 剛 さんが3年以上前に更新
Redmine 4.2 / RedMica 1.3より、ユーザーとプロジェクトの誤削除防止対策が組み込まれます。
ユーザー削除のときはログインID、プロジェクト削除のときはプロジェクト識別子の入力が確認画面で必要になります。
Patch #34417: Require explicit confirmation when deleting a user or a project