You are here

function example_perm_items in Coder 7

Same name and namespace in other branches
  1. 7.2 coder_upgrade/tests/old/samples/example.module \example_perm_items()

Other permission items in http://drupal.org/files/issues/506976_0.patch.

File

coder_upgrade/tests/old/samples/example.module, line 325

Code

function example_perm_items() {
  $options = array();
  foreach (module_implements('perm') as $module) {
    $function = $module . '_perm';
    if ($permissions = $function('perm')) {
      asort($permissions);
      foreach ($permissions as $permission => $description) {
        $options[t('@module module', array(
          '@module' => $module,
        ))][$permission] = t($permission);
      }
    }
  }
  foreach ($modules as $module) {
    $permissions = array_merge($permissions, array_keys(module_invoke($module, 'perm')));
  }

  // Check for permissions.
  if (in_array($module, module_implements('perm')) && $admin_access) {
    $admin_tasks[-1] = l(t('Configure permissions'), 'admin/user/permissions', array(
      'fragment' => 'module-' . $module,
    ));
  }
}