You are here

og_test.module in Organic groups 7

Same filename and directory in other branches
  1. 7.2 tests/og_test.module

Test module for Organic groups.

File

tests/og_test.module
View source
<?php

/**
 * @file
 * Test module for Organic groups.
 */

/**
 * Implements hook_node_access().
 */
function og_test_node_access($node, $op, $account) {
  $return = NODE_ACCESS_IGNORE;
  if ($op == 'update' && $node->title == 'deny access') {
    $return = NODE_ACCESS_DENY;
  }
  return $return;
}

/**
 * Implements hook_field_access().
 */
function og_test_field_access($op, $field, $entity_type, $entity, $account) {
  if (!variable_get('og_test_hide_audience', FALSE)) {
    return;
  }
  if ($field['field_name'] != OG_AUDIENCE_FIELD) {
    return;
  }
  if ($op != 'edit') {
    return;
  }
  return FALSE;
}

Functions