function 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/api.elmsln.org/includes/bootstrap.inc).
cis7 field.module field_access($op, $field, $entity_type, $entity = NULL, $account = NULL)
cle7 field.module field_access($op, $field, $entity_type, $entity = NULL, $account = NULL)
elmsmedia7 field.module field_access($op, $field, $entity_type, $entity = NULL, $account = NULL)
icor7 field.module field_access($op, $field, $entity_type, $entity = NULL, $account = NULL)
meedjum_blog7 field.module field_access($op, $field, $entity_type, $entity = NULL, $account = NULL)
mooc7 field.module field_access($op, $field, $entity_type, $entity = NULL, $account = NULL)

Determine whether the user has access to a given field.

Parameters

$op: The operation to be performed. Possible values:

  • 'edit'
  • 'view'

$field: The full field structure array for the field on which the operation is to be performed. See field_info_field().

$entity_type: The type of $entity; e.g., '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; FALSE if the operation is denied.

Related topics

16 calls to field_access()
diff_entity_fields_diff in sites/all/modules/ulmus/diff/diff.diff.inc
Internal callback to handle fieldable entities.
email_mail_page_access in sites/all/modules/ulmus/email/email.module
Access callback for the email contact page.
entityreference_autocomplete_access_callback in sites/all/modules/ulmus/entityreference/entityreference.module
Menu Access callback for the autocomplete widget.
entity_metadata_field_access_callback in sites/all/modules/ulmus/entity/modules/callbacks.inc
Callback to determine access for properties which are fields.
entity_views_handler_field_field::access in sites/all/modules/ulmus/entity/views/handlers/entity_views_handler_field_field.inc
Return TRUE if the user has access to view this field.

... See full list

File

modules/field/field.module, line 982
Attach custom data fields to Drupal entities.

Code

function field_access($op, $field, $entity_type, $entity = NULL, $account = NULL) {
  global $user;

  if (!isset($account)) {
    $account = $user;
  }

  foreach (module_implements('field_access') as $module) {
    $function = $module . '_field_access';
    $access = $function($op, $field, $entity_type, $entity, $account);
    if ($access === FALSE) {
      return FALSE;
    }
  }
  return TRUE;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.