You are here

function oa_access_modules_installed in Open Atrium Core 7.2

Implements hook_modules_installed().

Check each new module enabled to see if it defines some oa_access_permisions and if they are type OA_ACCESS_GROUP_DEFAULT_OPTION_ALL or OA_ACCESS_TEAM_DEFAULT_OPTION_ALL, then we set the 'All' permission for all existing Groups and Teams.

File

modules/oa_access/oa_access.module, line 237
Code for the Open Atrium Access module.

Code

function oa_access_modules_installed($modules) {
  $permission_modules = array();
  foreach ($modules as $module) {
    $func = $module . '_oa_access_permission';
    if (function_exists($module . '_oa_access_permission')) {
      $permission_modules[] = $module;
    }
  }
  if (!empty($permission_modules)) {

    // Gather all the permissions we intend to initialize.
    $permissions = array();
    foreach (oa_access_get_permissions(TRUE) as $name => $perm) {
      if (in_array($perm['module'], $permission_modules)) {
        $permissions[$name] = $perm;
      }
    }

    // Initialize them all at once (to avoid pulling groups multiple times).
    oa_access_initialize_permissions($permissions);
  }
}