I am using a combination of the following modules / tricks:
- Drupal 6.x
- filefield
- view_own
- nodeaccess_userreference
- content_permissions (permissions for specific cck fields, it lives in a subfolder of CCK)
- http://www.drupalcoder.com/story/406-mixing-private-and-public-downloads...

Now I want access checking for my filefield files based on the rules defined by view_own, nodeaccess_userreference and content permissions (or at least for nodeaccess_userreference). Right now the nodeaccess_userreference permission rules are ignored for file downloads.

The idea is to have download areas for different clients who have paid for their content.

Any idea how to solve this? I make this a feature request for now, but it might turn into a support request if a solution can be found.

Comments

danielb’s picture

This is a node access module, nothing to do with files. You could create another module that uses hook_file_download to check if the user has access to the node the file is from. I wonder whether such a module exists - seems like an obvious feature :/

donquixote’s picture

The solution can be found in this filefield issue,
http://drupal.org/node/516104
"Node access check for private files does not check node_access()"

A fix is already contained in the latest development version of filefield.

Actually, I'm not sure if this works perfectly well with the method from drupalcoder.com. On my install I do it a bit differently.

danielb’s picture

Status: Active » Closed (fixed)

Yeah cool - I don't think it's something we can or should address in this module.