module_grants_test_number.module in Module Grants 7
Dummy module implementing node access related hooks to test access interaction with the Module Grants module.
File
tests/module_grants_test_number.moduleView source
<?php
/**
* @file
* Dummy module implementing node access related hooks to test access interaction with
* the Module Grants module.
*
*/
function module_grants_test_number_get_grants() {
return array(
'number' => array(
'one' => 1,
'two' => 2,
'three' => 3,
),
);
}
/**
* Implements hook_permission().
*
* Sets up permissions for this module.
*/
function module_grants_test_number_permission() {
return _module_grants_test_get_permissions(module_grants_test_number_get_grants());
}
/**
* Implements hook_node_grants().
*/
function module_grants_test_number_node_grants($account, $op) {
return _module_grants_test_get_node_grants(module_grants_test_number_get_grants(), $account, $op);
}
/**
* Implements hook_node_access_records().
*/
function module_grants_test_number_node_access_records($node) {
return _module_grants_test_get_node_access_records(module_grants_test_number_get_grants(), $node);
}
/**
* Implement hook_module_grants_realm_function_register
*/
function module_grants_test_number_module_grants_realm_function_register_alter(&$function_registry) {
$function_registry['module_grants_test_number'] = function ($realm) {
return array_key_exists($realm, module_grants_test_number_get_grants());
};
}
Functions
Name | Description |
---|---|
module_grants_test_number_get_grants | @file Dummy module implementing node access related hooks to test access interaction with the Module Grants module. |
module_grants_test_number_module_grants_realm_function_register_alter | Implement hook_module_grants_realm_function_register |
module_grants_test_number_node_access_records | Implements hook_node_access_records(). |
module_grants_test_number_node_grants | Implements hook_node_grants(). |
module_grants_test_number_permission | Implements hook_permission(). |