You are here

function hook_enabled in ACL 7

Same name and namespace in other branches
  1. 8 acl.api.php \hook_enabled()

Inform ACL module that the client module is enabled.

ACL will not return its NA records for your module if your module does not confirm that it's active.

If you use the example below, you can disable ACL on hook_disable using:

function MYMODULE_disable() {
  MYMODULE_enabled(FALSE);
}
1 invocation of hook_enabled()
acl_node_access_records in ./acl.module
Implements hook_node_access_records().

File

./acl.api.php, line 31
API documentation for ACL.

Code

function hook_enabled($set = NULL) {
  static $enabled = TRUE;

  // not drupal_static!
  if ($set !== NULL) {
    $enabled = $set;
  }
  return $enabled;
}