view sites/all/modules/restws/tests/restws_test.module @ 4:ce11bbd8f642

added modules
author danieleb <danielebarchiesi@me.com>
date Thu, 19 Sep 2013 10:38:44 +0100
parents
children
line wrap: on
line source
<?php

/**
 * @file
 * RESTful web services test module.
 */

/**
 * Implements hook_restws_resource_info_alter().
 *
 * @see RestWSTestCase::testMenuPath().
 */
function restws_test_restws_resource_info_alter(&$resource_info) {
  $resource_info['node']['menu_path'] = 'foo';
}

/**
 * Implements hook_field_access().
 *
 * @see RestWSTestCase::testFieldAccess()
 */
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;
}