You are here

function config_perms_menu_alter in Custom Permissions 6.2

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

Implementation of hook_menu_alter().

File

./config_perms.module, line 109
Adds more granular permissions for items under 'administer site configuration'.

Code

function config_perms_menu_alter(&$items) {
  foreach (config_perms_perms() as $perm) {
    foreach ($perm->path as $path) {
      if ($items[$path]) {
        $items[$path]['access callback'] = 'config_perms_access_callback';
        $items[$path]['access arguments'] = array(
          $perm,
        );
      }
    }
  }

  // administer themes:
  // TODO

  /*
  foreach (list_themes() as $theme) {
    $items['admin/build/themes/settings/'. $theme->name]['access callback'] = 'config_perms_themes_access';
    $items['admin/build/themes/settings/'. $theme->name]['access arguments'] = array($theme);
  }
  */
}