og_test.module in Organic groups 7
Same filename and directory in other branches
Test module for Organic groups.
File
tests/og_test.moduleView 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
Name | Description |
---|---|
og_test_field_access | Implements hook_field_access(). |
og_test_node_access | Implements hook_node_access(). |