Opened 17 years ago
Closed 17 years ago
#6239 closed defect (fixed)
can't delete attachment if no HTML preview is available
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.11 |
Component: | attachment | Version: | 0.10.4 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Be a user with WIKI_DELETE privilege. Attach an MS Word document to a Trac page (e.g. foo.doc). Click on the link to the attachment. This goes to a page saying "HTML preview not available". Notice there is no "Delete Attachment" button, and no way to delete the attachment (as far as I can tell).
If a text file is attached, the user can delete it, as expected.
Attachments (0)
Change History (7)
comment:1 by , 17 years ago
Keywords: | needinfo added |
---|
comment:2 by , 17 years ago
I think you are right. The problem goes away if I close all browser sessions and then reopen. (Firefox 2.0.0.8 on Winxp.)
I have confirmed that after the Trac permissions are changed, Firefox still caches an old version of the page, even after pushing Refresh.
comment:3 by , 17 years ago
Strangely, #3271 says that it only happens with text files, not binary ones such as the problem you reported. This does appear to be a caching problem though.
comment:5 by , 17 years ago
OK by me to close.
If the permissions are changed using trac-admin (so the user gains WIKI_DELETE privilege), a Firefox user may see out of date pages (without the Delete Attachment button) until the Firefox cache is cleared. This seems not ideal, but acceptable.
comment:6 by , 17 years ago
Component: | wiki → attachment |
---|---|
Keywords: | needinfo removed |
Milestone: | → 0.11.1 |
Status: | new → assigned |
Simple fix:
-
trac/attachment.py
617 617 618 618 def _render_view(self, req, attachment): 619 619 req.perm(attachment.resource).require('ATTACHMENT_VIEW') 620 req.check_modified(attachment.date) 620 can_delete = 'ATTACHMENT_DELETE' in req.perm(attachment.resource) 621 req.check_modified(attachment.date, str(can_delete)) 621 622 622 623 data = {'mode': 'view', 623 624 'title': get_resource_name(self.env, attachment.resource),
comment:7 by , 17 years ago
Milestone: | 0.11.1 → 0.11 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Patch committed as r6656.
Potentially a duplicate of #3271. What browser (and version) are you using?