You are here

function config_perms_menu_alter in Custom Permissions 7.2

Same name and namespace in other branches
  1. 6.2 config_perms.module \config_perms_menu_alter()
  2. 6 config_perms.module \config_perms_menu_alter()

Implements hook_menu_alter().

File

./config_perms.module, line 121
Allows additional permissions to be created and managed through a administration form

Code

function config_perms_menu_alter(&$items) {

  // Run through all menu items and leter them accordingly
  foreach ($items as $key => $item) {
    foreach (config_perms_perms() as $perm) {
      foreach ($perm->path as $path) {
        if (drupal_match_path($key, $path) && $perm->status) {
          $items[$key]['access callback'] = 'user_access';
          $items[$key]['access arguments'] = array(
            $perm->name,
          );
        }
      }
    }
  }
}