You are here

function acb_get_modules in Access Control Bridge 7

Same name and namespace in other branches
  1. 8 acb.module \acb_get_modules()

Returns a list of all active access control modules.

Parameters

bool $self: Boolean indicating if acb itself should be included in the list.

Return value

array An array containing all active access controlling modules.

3 calls to acb_get_modules()
acb_modules_enabled in ./acb.module
Implements hook_modules_enabled().
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 29
Drupal hooks and functions for the acb module.

Code

function acb_get_modules($self = FALSE) {
  $modules = array_unique(array_merge(module_implements('node_grants'), module_implements('node_access_records')));

  // Exclude ACL as it doesn't control anything on its own.
  $exclude = array(
    'acl',
  );
  if ($self) {
    $exclude[] = 'acb';
  }

  // Sort the list so the modules are always returned in the same order.
  sort($modules);
  return array_diff($modules, $exclude);
}