You are here

function restws_test_field_access in RESTful Web Services 7

Same name and namespace in other branches
  1. 7.2 tests/restws_test.module \restws_test_field_access()

Implements hook_field_access().

See also

RestWSTestCase::testFieldAccess()

File

tests/restws_test.module, line 13
RESTful web services test module.

Code

function restws_test_field_access($op, $field, $entity_type, $entity, $account) {
  if ($field['field_name'] == 'field_text' && $op == 'edit') {

    // Only allow edit access for a higher level permission.
    return user_access('administer users', $account);
  }
  return TRUE;
}