summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Haug2011-04-27 16:30:42 -0600
committerNathan Haug2011-04-27 16:30:42 -0600
commit044b4484e5c2605e716b4f51af242d00b6c8700d (patch)
treed4c6c4da293a714c5fa549a274ee93c60e9a8c19
parent4ba3fc3f2342bbd51f5e405e38fa077dfec96f18 (diff)
Issue #1126198: Allow users without "access content" permission to
upload files.
-rw-r--r--filefield.module12
1 files changed, 2 insertions, 10 deletions
diff --git a/filefield.module b/filefield.module
index 976544b..c199990 100644
--- a/filefield.module
+++ b/filefield.module
@@ -545,22 +545,14 @@ function filefield_filefield_icon_sets() {
* us to check, so we can make sure that the user may actually edit the file.
*/
function filefield_edit_access($type_name, $field_name, $node = NULL) {
- if (!content_access('edit', content_fields($field_name, $type_name), NULL, $node)) {
- return FALSE;
- }
- // No content permissions to check, so let's fall back to a more general permission.
- return user_access('access content') || user_access('administer nodes');
+ return content_access('edit', content_fields($field_name, $type_name), NULL, $node);
}
/**
* Access callback that checks if the current user may view the filefield.
*/
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.
- return user_access('access content') || user_access('administer nodes');
+ return content_access('view', content_fields($field_name), NULL, $node);
}
/**