[E-Commerce] [development] hook_fileapi (file products and download permission)

Dave Cohen drupal at dave-cohen.com
Tue May 9 00:19:59 UTC 2006

Did my original post make it to both developement and ecommerce mailing lists? 
(It was supposed to but I only received one copy in my inbox.)

Nedjo, thanks for the reply.

On Monday 08 May 2006 15:45, Nedjo Rogers wrote:
> Likley we'd want to keep it as close as possible to existing _api and
> _access hooks. So, e.g.,
> * @param $op
> *   The type of event ('upload', 'download', 'update', 'delete')
> might be better as
> * @param $op
> *   The type of event ('insert', 'view', 'update', 'delete')

I am fine with that.  Not certain the list of ops that apply to files will 
always be the same as those that apply to nodes, but I can't think of a 
counterexample now.

> Are you thinking of doing this as a contrib module for 4.7? Part of
> ecommerce, or a generic file handling module?

I'm thinking of an ecommerce module (maybe ecommerce/contrib, maybe modifying 
ecommerce/file/file.module) which implements the hooks and allows downloads 
only when a node has been purchased.

And modifying audio.module to invoke the hooks as I described in pseudocode.

If there is widespread adoption, upload.module (and probably others) should 
then emulate audio.module.  I'm mostly concerned with the MP3 product I am 
trying to build.   But if I build it using these hooks, I'd like to think 
they could serve others as well.


More information about the development mailing list