Prevent accidental deletion of contents with sudo mode
|Assignee:||Go MAEDA||% Done:|
The attached patch adds protection against deletion of contents such as issues, wiki pages, and attachments by expanding operations covered by sudo mode that has been added in Redmine 3.1 (#19851).
Users sometimes mistakenly delete contents like issues. I think it is because deleting contents is so easy if they have appropriate permissions.
I think such accidents can be reduced with sudo mode. If sudo mode guards deletion of contents as well by requiring re-entering a password, users can have an opportunity to reconsider the operation.
Step 1: the user see "Are you sure?" dialog after clicking "Delete" button. Not a few users press OK without thinking.
Step 2: if sudo mode is enabled in configuration.yml and the attached patch is applied, Redmine requires user to re-enter their password before performing deletion. The user may notice that they are doing a daingerous operation.
- File 0001-Require-sudo-mode-for-actions-to-delete-contents.patch added
- Target version set to Candidate for next major release
Added tests to the patch.
#7 Updated by Marius BALTEANU 8 months ago
Go MAEDA wrote:
Committed the patch.
Even if the patch is already committed, I think it's too much to require the password for delete actions and to have this feature only for the instances with sudo mode enabled. I think making the delete action harder, it's good idea. What I saw in the last period in many web applications (starting from cloud platforms to Github, Gitlab) it's a custom confirmation modal that requires a manual input like "yes" from the user in order to continue the action.
Also, in some cases like issue page, the delete button it's easily mismatch with the delete button from comment and what we can do there is to hide the button under actions dropdown.
I'm reopening this to take more feedback from the users, I don't think that such a change should go so quickly in the next release.
It will be nice if an alternative implementation is introduced before the release of 4.2.0.
But I believe that a mechanism to guard contents against such accidents is indispensable and the sudo mode works well until another mechanism is implemented. I will happily replace this if another patch is suggested.
Before that, I think the sudo mode is a good workaround. Probably not many instances enable sudo mode, the instances influenced by this extended sudo mode are limited. So, most users Redmine can delete contents as usual even after their instance is upgraded.
#10 Updated by Miodrag Milic 3 months ago
I support Go Maeda in this.
This happens so frequently (even to those like me that use Redmine daily for decade, due to that funky journal delete button being on wrong place) that its better to have current implementation then wait for something else. Is it really important what I type ? yes or password ?
This should eventually support bulk operation (not sure if it does now). It is very important for spammy plugins like service desks.