Issue267

Title Make the 'remove' buttons less annoying
Priority bug Status chatting
Superseder Nosy List ajaksu2, hthompson, loewis
Assigned To Topics

Created on 2009-04-08.02:47:14 by ajaksu2, last changed 2009-08-26.22:06:07 by hthompson.

Files
File name Uploaded Type Edit Remove
undo_and_audit_remove2.diff ajaksu2, 2009-04-13.17:38:26 text/plain
Messages
msg1458 (view) Author: hthompson Date: 2009-08-26.22:06:06
Not sure if you mind random folks from commenting on here.  I found your html
and python for the restore button and unlink auditor very helpful.  After a bit
of tweaking I got it working for me.  Thanks.  One problem I notice testing
this, is that the roundup message order "reverse" seems to fail after doing a
restore.  It seems that the order it is using is the date edited order rather
than the original date order (even though the original date is what is shown). 
Have you noticed this or is this just a problem I have because I don't know how
to do anything other than the default "reverse" ordering of messages?
msg1326 (view) Author: ajaksu2 Date: 2009-04-13.17:38:25
This new version forbids re-linking an already linked file or message to
another issues.

If any part of this patch is desirable, maybe it'd be better to split it into
'allow restoring' and 'audit linking/unlinking' detectors?

Also tracked at http://issues.roundup-tracker.org/issue2550536
msg1325 (view) Author: ajaksu2 Date: 2009-04-13.16:55:33
Martin v. Löwis wrote::
> What's wrong with allowing users to unlink arbitrary files? Anybody who has
> write access to the files property should be allowed to do so.

I thought the write access was about adding new files, while removing
files should be restricted to those the user has created. At least the
UI only renders the 'remove button' according to the permission below:

def may_edit_file(db, userid, itemid):
    return userid == db.file.get(itemid, "creator")
p = db.security.addPermission(name='Edit', klass='file', check=may_edit_file,
    description="User is allowed to remove their own files")
db.security.addPermissionToRole('User', p)

However, it's possible to perform the Edit action on any files even if
the remove button isn't shown:
http://localhost:9999/python-dev/issue2169?@action=edit&@remove@files=29

IMO this makes it easier to disrupt tracker work, besides making it
trivial replace valid files/patches with exploit-ish ones.
msg1324 (view) Author: loewis Date: 2009-04-13.12:46:25
What's wrong with allowing users to unlink arbitrary files? Anybody who has
write access to the files property should be allowed to do so.
msg1322 (view) Author: ajaksu2 Date: 2009-04-12.23:56:41
Fix typo.
msg1321 (view) Author: ajaksu2 Date: 2009-04-12.23:24:08
Enhanced auditor to fix a minor security hole: any User can link/unlink files
and messages to/from any issue.
msg1315 (view) Author: ajaksu2 Date: 2009-04-08.23:33:19
Cleaner auditor.
msg1313 (view) Author: ajaksu2 Date: 2009-04-08.02:47:13
I've seen many people delete messages by accident. Recently, Guilherme Polo
posted a workaround for re-adding them[1]. I've only added UI and a way to store
the issue ID on unlinking.

This patch adds an auditor to that stores the issue ID on a removed file or
message, and offers a 'restore' button on message or file item pages that allows
re-linking to the original issue.

The restore form is only shown for messages/files the unlink auditor marked with
an issue ID.

I'd also like to add JS guards (confirmations) to the remove buttons, will
provide a patch after most issue.item.html patches land.

[1] http://bugs.python.org/msg84430
History
Date User Action Args
2009-08-26 22:06:07hthompsonsetnosy: + hthompson
messages: + msg1458
2009-04-28 13:05:34ajaksu2setfiles: - undo_and_audit_remove.diff
2009-04-28 13:05:20ajaksu2setfiles: - undo_remove2.diff
2009-04-13 17:38:26ajaksu2setfiles: + undo_and_audit_remove2.diff
messages: + msg1326
2009-04-13 16:55:35ajaksu2setmessages: + msg1325
2009-04-13 12:46:25loewissetnosy: + loewis
messages: + msg1324
2009-04-12 23:56:41ajaksu2setfiles: + undo_and_audit_remove.diff
messages: + msg1322
2009-04-12 23:55:54ajaksu2setfiles: - undo_and_audit_remove.diff
2009-04-12 23:24:08ajaksu2setfiles: + undo_and_audit_remove.diff
messages: + msg1321
2009-04-08 23:33:38ajaksu2setfiles: - undo_remove.diff
2009-04-08 23:33:20ajaksu2setfiles: + undo_remove2.diff
status: unread -> chatting
messages: + msg1315
2009-04-08 02:47:14ajaksu2create