In the past, several users have been asking whether there was a chance to hide some item’s files to public viewers (for copyright or other reasons); the general answer seemed to be that they might want to do at code level for public pages, but that the feature itself was not available in Omeka.
Having to solve a similar problem myself, I thought I would give it a go.
My idea would be to create a plugin (Hide Files) that introduces a “public” field (exactly like the one present in Items table in the Omeka’s database), defaulting to true; then, adds to the admin
file/edit pages an Is Public field (exactly as for Items and Collections), and then use that value in file_markup filter to hide the file (maybe replacing it with a “file not shown because…” warning) when the public field was false.
I’d like to pick your brains about some things:
- would it be better to add a “public” column to the “files” core table in the database, or to create a “hideFiles” table instead; I’m not particularly keen on messing up with core tables, as they might be changed in the future, but it would seem to me as a cleaner option (a column for a table);
- there seems to be no filter applied to
item_image_gallery(see Any filter that applies to item_image_gallery?); how to use the new field also in that function?
- would it be better to allow for files hiding also on Admin side, according to user level/rights?
Any advice will be well received, thanks.