summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Haug2010-12-06 06:53:06 +0000
committerNathan Haug2010-12-06 06:53:06 +0000
commit7b27aa5ecfeb348e8836161f8e42c29544e46365 (patch)
treeaba55e8fc33311129ec24e0e47cc1a3822d3f52a
parent3a57bc8263d7fca30a78c182034b8e8c8ea09836 (diff)
#833054: Restoring the $node parameter to filefield_view_access() as an optional parameter.
-rw-r--r--filefield.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/filefield.module b/filefield.module
index ee28bc1..d90fa71 100644
--- a/filefield.module
+++ b/filefield.module
@@ -188,7 +188,7 @@ function filefield_file_download($filepath) {
if (isset($nodes[$content['nid']])) {
continue; // Don't check the same node twice.
}
- if (($node = node_load($content['nid'])) && (node_access('view', $node) && filefield_view_access($field_name))) {
+ if (($node = node_load($content['nid'])) && (node_access('view', $node) && filefield_view_access($field_name, $node))) {
$denied = FALSE;
break 2;
}
@@ -514,8 +514,8 @@ function filefield_edit_access($type_name, $field_name) {
/**
* Access callback that checks if the current user may view the filefield.
*/
-function filefield_view_access($field_name) {
- if (!content_access('view', content_fields($field_name))) {
+function filefield_view_access($field_name, $node = NULL) {
+ if (!content_access('view', content_fields($field_name), NULL, $node)) {
return FALSE;
}
// No content permissions to check, so let's fall back to a more general permission.