You are here

function emthumb_edit_access in Embedded Media Field 6.2

Same name and namespace in other branches
  1. 6.3 contrib/emthumb/emthumb.module \emthumb_edit_access()

Access callback for the JavaScript upload and deletion AHAH callbacks.

The content_permissions module provides nice fine-grained permissions for us to check, so we can make sure that the user may actually edit the file.

1 call to emthumb_edit_access()
emthumb_widget_element_process in contrib/emthumb/emthumb.module
Process our emthumb element.
1 string reference to 'emthumb_edit_access'
emthumb_menu in contrib/emthumb/emthumb.module
Implementation of hook_menu().

File

contrib/emthumb/emthumb.module, line 28
Allows for custom thumbnail overrides to Embedded Media Field.

Code

function emthumb_edit_access($field_name) {
  if (!content_access('edit', content_fields($field_name))) {
    return FALSE;
  }

  // No content permissions to check, so let's fall back to a more general permission.
  return user_access('access content');
}