Ticket #3068 (closed enhancement: fixed)
Extensible Attachments
| Reported by: | Pedro Algarvio, aka, s0undt3ch <ufs@…> | Owned by: | cboos |
|---|---|---|---|
| Priority: | high | Milestone: | 0.11 |
| Component: | attachment | Version: | 0.9.5 |
| Severity: | normal | Keywords: | tracobject security |
| Cc: | ufs@… |
Description
After a talk with alect on #trac he sugested that this ticket was created.
The Problem:
I'm developing a plugin(WikiTemplates) that will need to support attachments, and, by looking at trac's code, the AttachmentModule only supports wiki and ticket attachments, it doesn't support any other type of attachment.
Possible Solutions:
- Create a copy of the attachment.py with the necessary changes, ie, deal with attachments under a different handler, and probalably under a diferent table;
- Subclass the classes on attachment.py to add a new attachment type. But this raises a problem. Since it's subclassed, in order to use WikiTemplates attachments, the one that trac provides must be disabled in order for them to work.
And what if another user creates some other plugin that needs attachment support and takes the same road I do? Both plugins can't be used at the same time.
Which brings us to the ticket summary and the next solution; - Modify attachment.py so that it's extensible. This way, anyone wanting to use attachments on their plugins would have to for example register their type, and trac would create the necessary dir(s) under /path/to/trac/env/attachments, add the new type to the match_request(), and probably also pass the permissions needed to handle this new type of attachment.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


