Forum OpenACS Q&A: Ideas to improve OpenACS attachments

Collapse
Posted by Dave Bauer on
Currently the OpenACS Attachments package requires a file-storage package instance for every application instance that requires attacment support. So, in .LRN every class has a file-storage instance and attachments instance. Attachments can only be uploaded into folders within that particular file-storage instance. This is actually a good idea for privacy reasons of the educational setting that .LRN is designed for. It makes it a pain for more general usage. In addition, a user cannot upload attachments from their personal folder that is assigned to every .LRN user.

My idea is for a general solution to mount one attachments instance (per subsite) and give every user a personal folder in that instance. Then, offer to the user on upload to put the item by default in their personal folder, and then to show a list of all file-storage root folders the user has CREATE (or WRITE) privilege over. The user could drill down into those folders to choose the ultimate destination folder.

It should be possible for an application to supress the dialog and only allow upload into the users personal attachments folder. This would be to simpify the user interface for many applications.

Allowing upload to one folder per user would make it easier to enforce item and folder contents size limits per user.

The main issue to address is permission on the uploaded items. It seems that attached items should inherit permission from the item they are attached to. At least. Perhaps some additional permissions should also be applied. Probably the uploading user should have admin over the attachment object as well.

More design thought required.

Collapse
Posted by Don Baccus on
Why do attachments need to be in a folder at all?  Why can't the attachment simply be a child of the object the attachment is attached to?  Isn't his why we have an object-based system?

In other words, is there any valid reason why attachments aren't just cr_items rather than file storage items?

Collapse
Posted by Dave Bauer on
Don,

This requires more design. I have asked before and it seems existing users do use the current behavior of attachments with file-storage.

So, for now, I am going to do my own thing, mapping the attachment to another object. In the future it should be possible to attach an uploaded object, or a file-storage object using the same user interface, without requiring the object be stored in a file-storage instance.