--- devel.module +++ (clipboard) @@ -615,13 +615,16 @@ } function devel_block_switch_user() { - $links = devel_switch_user_list(); - if (!empty($links)) { - $block['subject'] = t('Switch user'); - $build['devel_links'] = array('#theme' => 'links', '#links' => $links); - $build['devel_form'] = drupal_get_form('devel_switch_user_form'); - $block['content'] = $build; - return $block; + if (user_access('switch users')) { + $list_size = variable_get('devel_switch_user_list_size', 10); + $links = devel_switch_user_list(); + if (!empty($links) or $list_size == 0) { + $block['subject'] = t('Switch user'); + $build['devel_links'] = array('#theme' => 'links', '#links' => $links); + $build['devel_form'] = drupal_get_form('devel_switch_user_form'); + $block['content'] = $build; + return $block; + } } }