function hook_field_access


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 field.api.php hook_field_access($op, $field, $entity_type, $entity, $account)
cle7 field.api.php hook_field_access($op, $field, $entity_type, $entity, $account)
elmsmedia7 field.api.php hook_field_access($op, $field, $entity_type, $entity, $account)
icor7 field.api.php hook_field_access($op, $field, $entity_type, $entity, $account)
meedjum_blog7 field.api.php hook_field_access($op, $field, $entity_type, $entity, $account)
mooc7 field.api.php hook_field_access($op, $field, $entity_type, $entity, $account)

Determine whether the user has access to a given field.

This hook is invoked from field_access() to let modules block access to operations on fields. If no module returns FALSE, the operation is allowed.


$op: The operation to be performed. Possible values: 'edit', 'view'.

$field: The field on which the operation is to be performed.

$entity_type: The type of $entity; for example, 'node' or 'user'.

$entity: (optional) The entity for the operation.

$account: (optional) The account to check; if not given use currently logged in user.

Return value

TRUE if the operation is allowed, and FALSE if the operation is denied.

Related topics

8 functions implement hook_field_access()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

ds_extras_ds_field_access in sites/all/modules/ulmus/ds/modules/ds_extras/ds_extras.module
DS fields access.
entityreference_prepopulate_field_access in sites/all/modules/ulmus/entityreference_prepopulate/entityreference_prepopulate.module
Implements hook_field_access().
field_group_test_field_access in sites/all/modules/ulmus/field_group/tests/field_group_test.module
Implements hook_field_access().
field_test_field_access in modules/field/tests/
Implements hook_field_access().
og_field_access in sites/all/modules/ulmus/og/og.module
Implements hook_field_access().

... See full list

2 invocations of hook_field_access()
field_access in modules/field/field.module
Determine whether the user has access to a given field.
imce_wysiwyg_plugin in sites/all/modules/ulmus/imce_wysiwyg/imce_wysiwyg.module
Implements hook_wysiwyg_plugin().


modules/field/field.api.php, line 2689


function hook_field_access($op, $field, $entity_type, $entity, $account) {
  if ($field['field_name'] == 'field_of_interest' && $op == 'edit') {
    return user_access('edit field of interest', $account);
  return TRUE;