Integration with webfm
| Project: | Protected node |
| Version: | 6.x-1.5 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Hi,
I'd like to ask if there is a chance to get webfm and protected node to work together.
The problem: webfm checks if a user can access a node to which a file is attached via node_access. If access is granted for the node, the user can download files attached to this node.
But protected_node doesn't use node_access (I guess that is because the access permission must be changed on a browser-session base without changing the node_access table (as that would be permanent)) but prevents access via nodeapi('view').
Thus, files attached with webfm to pages that are protected with protected_node can be downloaded, even if the user cannot access the page itself.
If both maintainers agree (I will ask Rob to read this thread, too) I would try to make those two modules work together. I guess all that's needed is a call like drupal_alter('webfm_perm', $MATCH, $nid, $fid) in webfm, so that $MATCH could be changed, based on the nid and fid.
And in protected_node we would need to implement hook_webfm_perm, containing basically the same code as in nodeapi('view'), setting $MATCH to false if the node is protected.
What do you think? I would try to create patches for both webfm and protected_node if there are no reservations about such an approach.
Or maybe one of you has even a better idea how to bring the modules together?
cu,
Frank

#1
protected_node_file_download() cannot take care of this problem?
Also I'm okay with this, but I don't plan to add features to 5.x version. So make this a 6.x patch only.
#2
Hi Frank - I've been out of the webfm loop due to my workload and I don't know the first thing about "protected_node". My workload won't diminish anytime soon so I will not be able to help out - you have my full support for making changes that improve the module. Ping me again when a patch warrants a commit.
-rob
#3
> protected_node_file_download() cannot take care of this problem?
No, because webfm uses a completely different mechanism (and sql tables) for handling files. It manages files completely independent from nodes, i.e., you can upload files that are not attached anywhere. Then you can attach uploaded files to as many nodes as you like, but those attachments are more like symbolic links to the real files that are handled in webfm. This doesn't match the normal file upload.
Ok, thanks both of you for the positive feedback, I will try to create a patch.
#4
I post both patches here if someone wants to test how it works together with webfm.
The protected-node-related patch alone shouldn't change the protected-node behaviour at all.
#5
#6
Any chance with this feature? :-)