function acb_is_module_realm in Access Control Bridge 8
Same name and namespace in other branches
- 7 acb.module \acb_is_module_realm()
Checks if a realm is originating from a specified module.
Parameters
string $realm: A string containing a realm machine_name
string $module: A module's machine name
Return value
bool TRUE if the specified realm originates from the given module, FALSE otherwise.
2 calls to acb_is_module_realm()
- acb_node_access_records_alter in ./
acb.module - Implements hook_node_access_records_alter().
- acb_node_grants_alter in ./
acb.module - Implements hook_node_grants_alter().
File
- ./
acb.module, line 210 - Drupal hooks and functions for the acb module.
Code
function acb_is_module_realm($realm, $module) {
// Just in case, ensure consistency.
if ($module == 'domain_access') {
$module = 'domain';
}
switch ($realm) {
case 'term_access':
return $module == 'taxonomy_access';
break;
default:
return strpos($realm, $module) === 0;
break;
}
}