You are here

function fasttoggle_user_permission in Fasttoggle 7

Implements hook_perm().

File

module/fasttoggle_user/fasttoggle_user.module, line 27

Code

function fasttoggle_user_permission() {
  $available_roles = fasttoggle_sitewide_toggleable_roles();
  $roles = array();
  if (!empty($available_roles)) {
    foreach ($available_roles as $rid => $name) {
      $roles[fasttoggle_role_name($name)] = array(
        'title' => t('Toggle role @name', array(
          '@name' => $name,
        )),
      );
    }
  }
  $fixed_roles = array(
    'moderate users' => array(
      'title' => t('Moderate users'),
    ),
  );
  $result = array_merge($roles, $fixed_roles);
  asort($result);
  return $result;
}