Index: modules/aggregator/aggregator.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v
retrieving revision 1.378
diff -u -p -r1.378 aggregator.module
--- modules/aggregator/aggregator.module	23 Apr 2008 20:01:48 -0000	1.378
+++ modules/aggregator/aggregator.module	26 Apr 2008 18:44:00 -0000
@@ -278,10 +278,14 @@ function _aggregator_has_categories() {
  * Implementation of hook_perm().
  */
 function aggregator_perm() {
-  return array(
-    'administer news feeds' => t('Add, edit or delete news feeds that are aggregated to your site.'),
-    'access news feeds' => t('View aggregated news feed items.'),
+  $perms = array();
+  $perms['administer news feeds'] = array(
+    'description' => t('Add, edit or delete news feeds that are aggregated to your site.'),
   );
+  $perms['access news feeds'] = array(
+    'description' => t('View aggregated news feed items.'),
+  );
+  return $perms;
 }
 
 /**
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.304
diff -u -p -r1.304 block.module
--- modules/block/block.module	23 Apr 2008 20:01:48 -0000	1.304
+++ modules/block/block.module	26 Apr 2008 18:44:01 -0000
@@ -105,10 +105,15 @@ function block_theme() {
  * Implementation of hook_perm().
  */
 function block_perm() {
-  return array(
-    'administer blocks' => t('Select which blocks are displayed, and arrange them on the page.'),
-    'use PHP for block visibility' => t('Enter PHP code in the field for block visibility settings. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))),
+  $perms = array();
+  $perms['administer blocks'] = array(
+    'description' => t('Select which blocks are displayed, and arrange them on the page.'),
   );
+  $perms['use PHP for block visibility'] = array(
+    'description' => t('Enter PHP code in the field for block visibility settings.'),
+    'attributes' => array('security risk'),
+  );
+  return $perms;
 }
 
 /**
Index: modules/blogapi/blogapi.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/blogapi/blogapi.module,v
retrieving revision 1.118
diff -u -p -r1.118 blogapi.module
--- modules/blogapi/blogapi.module	14 Apr 2008 17:48:35 -0000	1.118
+++ modules/blogapi/blogapi.module	26 Apr 2008 18:44:02 -0000
@@ -25,7 +25,9 @@ function blogapi_help($path, $arg) {
  */
 function blogapi_perm() {
   return array(
-    'administer content with blog api' => t('Manage website content from external tools.'),
+    'administer content with blog api' => array(
+      'description' => t('Manage website content from external tools.'),
+    )
   );
 }
 
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.461
diff -u -p -r1.461 book.module
--- modules/book/book.module	25 Apr 2008 17:51:30 -0000	1.461
+++ modules/book/book.module	26 Apr 2008 18:44:03 -0000
@@ -40,12 +40,20 @@ function book_theme() {
  * Implementation of hook_perm().
  */
 function book_perm() {
-  return array(
-    'add content to books' => t('Add new content and child pages to books.'),
-    'administer book outlines' => t('Manage books through the administration panel.'),
-    'create new books' => t('Add new top-level books.'),
-    'access printer-friendly version' => t('View a book page and all of its sub-pages as a single document for ease of printing. Can be performance heavy.'),
+  $perms = array();
+  $perms['add content to books'] = array(
+    'description' => t('Add new content and child pages to books.'),
   );
+  $perms['administer book outlines'] = array(
+    'description' => t('Manage books through the administration panel.'),
+  );
+  $perms['create new books'] = array(
+    'description' => t('Add new top-level books.'),
+  );
+  $perms['access printer-friendly version'] = array(
+    'description' => t('View a book page and all of its sub-pages as a single document for ease of printing. Can be performance heavy.'),
+  );
+  return $perms;
 }
 
 /**
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.630
diff -u -p -r1.630 comment.module
--- modules/comment/comment.module	25 Apr 2008 18:34:05 -0000	1.630
+++ modules/comment/comment.module	26 Apr 2008 18:44:05 -0000
@@ -248,12 +248,20 @@ function comment_node_type($op, $info) {
  * Implementation of hook_perm().
  */
 function comment_perm() {
-  return array(
-    'access comments' => t('View comments attached to content.'),
-    'post comments' => t('Add comments to content (approval required).'),
-    'post comments without approval' => t('Add comments to content (no approval required).'),
-    'administer comments' => t('Manage and approve comments, and configure comment administration settings.'),
+  $perms = array();
+  $perms['access comments'] = array(
+    'description' => t('View comments attached to content.'),
+  );
+  $perms['post comments'] = array(
+    'description' => t('Add comments to content (approval required).'),
+  );
+  $perms['post comments without approval'] = array(
+    'description' => t('Add comments to content (no approval required).'),
+  );
+  $perms['administer comments'] = array(
+    'description' => t('Manage and approve comments, and configure comment administration settings.'),
   );
+  return $perms;
 }
 
 /**
Index: modules/contact/contact.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.module,v
retrieving revision 1.106
diff -u -p -r1.106 contact.module
--- modules/contact/contact.module	23 Apr 2008 20:01:49 -0000	1.106
+++ modules/contact/contact.module	26 Apr 2008 18:44:06 -0000
@@ -36,10 +36,14 @@ function contact_help($path, $arg) {
  * Implementation of hook_perm
  */
 function contact_perm() {
-  return array(
-    'access site-wide contact form' => t('Send feedback to administrators via e-mail using the site-wide contact form.'),
-    'administer site-wide contact form' => t('Configure site-wide contact form administration settings.'),
+  $perms = array();
+  $perms['access site-wide contact form'] = array(
+    'description' => t('Send feedback to administrators via e-mail using the site-wide contact form.'),
   );
+  $perms['administer site-wide contact form'] = array(
+    'description' => t('Configure site-wide contact form administration settings.'),
+  );
+  return $perms;
 }
 
 /**
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.210
diff -u -p -r1.210 filter.module
--- modules/filter/filter.module	23 Apr 2008 20:01:50 -0000	1.210
+++ modules/filter/filter.module	26 Apr 2008 18:44:07 -0000
@@ -154,9 +154,12 @@ function filter_admin_format_title($form
  * Implementation of hook_perm().
  */
 function filter_perm() {
-  return array(
-    'administer filters' => t('Manage input formats and filters, and select which roles may use them. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))),
+  $perms = array();
+  $perms['administer filters'] = array(
+    'description' => t('Manage input formats and filters, and select which roles may use them.'),
+    'attributes' => array('security risk'),
   );
+  return $perms;
 }
 
 /**
Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.455
diff -u -p -r1.455 forum.module
--- modules/forum/forum.module	23 Apr 2008 20:01:51 -0000	1.455
+++ modules/forum/forum.module	26 Apr 2008 18:44:08 -0000
@@ -325,8 +325,9 @@ function forum_access($op, $node, $accou
  * Implementation of hook_perm().
  */
 function forum_perm() {
-  $perms = array(
-    'administer forums' => t('Manage forums and configure forum administration settings.'),
+  $perms = array();
+  $perms['administer forums'] = array(
+    'description' => t('Manage forums and configure forum administration settings.'),
   );
   $perms += node_list_permissions('forum');
   return $perms;
Index: modules/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.217
diff -u -p -r1.217 locale.module
--- modules/locale/locale.module	23 Apr 2008 20:01:52 -0000	1.217
+++ modules/locale/locale.module	26 Apr 2008 18:44:10 -0000
@@ -195,10 +195,14 @@ function locale_inc_callback() {
  * Implementation of hook_perm().
  */
 function locale_perm() {
-  return array(
-    'administer languages' => t('Manage the languages in which the website content and interface text may be displayed.'),
-    'translate interface' => t('Translate the text of the website interface.'),
+  $perms = array();
+  $perms['administer languages'] = array(
+    'description' => t('Manage the languages in which the website content and interface text may be displayed.'),
+  );
+  $perms['translate interface'] = array(
+    'description' => t('Translate the text of the website interface.'),
   );
+  return $perms;
 }
 
 /**
Index: modules/menu/menu.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v
retrieving revision 1.162
diff -u -p -r1.162 menu.module
--- modules/menu/menu.module	23 Apr 2008 20:01:52 -0000	1.162
+++ modules/menu/menu.module	26 Apr 2008 18:44:10 -0000
@@ -37,9 +37,11 @@ function menu_help($path, $arg) {
  * Implementation of hook_perm().
  */
 function menu_perm() {
-  return array(
-    'administer menu' => t('Manage menus and menu items.'),
+  $perms = array();
+  $perms['administer menu'] = array(
+    'description' => t('Manage menus and menu items.'),
   );
+  return $perms;
 }
 
 /**
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.959
diff -u -p -r1.959 node.module
--- modules/node/node.module	23 Apr 2008 20:01:52 -0000	1.959
+++ modules/node/node.module	26 Apr 2008 18:44:13 -0000
@@ -1120,13 +1120,25 @@ function theme_node_log_message($log) {
  * Implementation of hook_perm().
  */
 function node_perm() {
-  $perms = array(
-    'administer content types' => t('Manage content types and content type administration settings.'),
-    'administer nodes' => t('Manage all website content, and bypass any content-related access control. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))),
-    'access content' => t('View published content.'),
-    'view revisions' => t('View content revisions.'),
-    'revert revisions' => t('Replace content with an older revision.'),
-    'delete revisions' => t('Delete content revisions.'),
+  $perms = array();
+  $perms['administer content types'] = array(
+    'description' => t('Manage content types and content type administration settings.'),
+  );
+  $perms['administer nodes'] = array(
+    'description' => t('Manage all website content, and bypass any content-related access control.'),
+    'attributes' => array('security risk'),
+  );
+  $perms['access content'] = array(
+    'description' => t('View published content.'),
+  );
+  $perms['view revisions'] = array(
+    'description' => t('View content revisions.'),
+  );
+  $perms['revert revisions'] = array(
+    'description' => t('Replace content with an older revision.'),
+  );
+  $perms['delete revisions'] = array(
+    'description' => t('Delete content revisions.'),
   );
 
   foreach (node_get_types() as $type) {
@@ -2781,11 +2793,21 @@ function node_list_permissions($type) {
   $type = check_plain($info->type);
 
   // Build standard list of node permissions for this type.
-  $perms["create $type content"] = t('Create new %type_name content.', array('%type_name' => $info->name));
-  $perms["delete any $type content"] = t('Delete any %type_name content, regardless of its author.', array('%type_name' => $info->name));
-  $perms["delete own $type content"] = t('Delete %type_name content created by the user.', array('%type_name' => $info->name));
-  $perms["edit own $type content"] = t('Edit %type_name content created by the user.', array('%type_name' => $info->name));
-  $perms["edit any $type content"] = t('Edit any %type_name content, regardless of its author.', array('%type_name' => $info->name));
+  $perms["create $type content"] = array(
+    'description' => t('Create new %type_name content.', array('%type_name' => $info->name)),
+  );
+  $perms["delete any $type content"] = array(
+    'description' => t('Delete any %type_name content, regardless of its author.', array('%type_name' => $info->name)),
+  );
+  $perms["delete own $type content"] = array(
+    'description' => t('Delete %type_name content created by the user.', array('%type_name' => $info->name)),
+  );
+  $perms["edit own $type content"] = array(
+    'description' => t('Edit %type_name content created by the user.', array('%type_name' => $info->name)),
+  );
+  $perms["edit any $type content"] = array(
+    'description' => t('Edit any %type_name content, regardless of its author.', array('%type_name' => $info->name)),
+  );
 
   return $perms;
 }
Index: modules/path/path.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.module,v
retrieving revision 1.142
diff -u -p -r1.142 path.module
--- modules/path/path.module	23 Apr 2008 20:01:53 -0000	1.142
+++ modules/path/path.module	26 Apr 2008 18:44:14 -0000
@@ -205,10 +205,14 @@ function path_form_alter(&$form, $form_s
  * Implementation of hook_perm().
  */
 function path_perm() {
-  return array(
-    'create url aliases' => t('Manage URL aliases on content.'),
-    'administer url aliases' => t('Manage URL aliases across the entire website.'),
+  $perms = array();
+  $perms['create url aliases'] = array(
+    'description' => t('Manage URL aliases on content.'),
   );
+  $perms['administer url aliases'] = array(
+    'description' => t('Manage URL aliases across the entire website.'),
+  );
+  return $perms;
 }
 
 /**
Index: modules/poll/poll.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v
retrieving revision 1.266
diff -u -p -r1.266 poll.module
--- modules/poll/poll.module	14 Apr 2008 17:48:41 -0000	1.266
+++ modules/poll/poll.module	26 Apr 2008 18:44:15 -0000
@@ -54,13 +54,19 @@ function poll_theme() {
  * Implementation of hook_perm().
  */
 function poll_perm() {
-  $perms = node_list_permissions('poll');
-  $perms += array(
-    'vote on polls' => t('Cast votes on polls.'),
-    'cancel own vote' => t('Retract and optionally change own votes.'),
-    'inspect all votes' => t('View voting results.'),
+  $perms = array();
+
+  $perms['vote on polls'] = array(
+    'description' => t('Cast votes on polls.'),
+  );
+  $perms['cancel own vote'] = array(
+    'description' => t('Retract and optionally change own votes.'),
+  );
+  $perms['inspect all votes'] = array(
+    'description' => t('View voting results.'),
   );
 
+  $perms += node_list_permissions('poll');
   return $perms;
 }
 
Index: modules/search/search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.module,v
retrieving revision 1.255
diff -u -p -r1.255 search.module
--- modules/search/search.module	23 Apr 2008 20:01:53 -0000	1.255
+++ modules/search/search.module	26 Apr 2008 18:44:18 -0000
@@ -141,11 +141,17 @@ function search_theme() {
  * Implementation of hook_perm().
  */
 function search_perm() {
-  return array(
-    'search content' => t('Search website content.'),
-    'use advanced search' => t('Limit search results with additional criteria, such as specific content types. Could have performance implications.'),
-    'administer search' => t('Configure search administration settings.'),
+  $perms = array();
+  $perms['search content'] = array(
+    'description' => t('Search website content.'),
   );
+  $perms['use advanced search'] = array(
+    'description' => t('Limit search results with additional criteria, such as specific content types. Could have performance implications.'),
+  );
+  $perms['administer search'] = array(
+    'description' => t('Configure search administration settings.'),
+  );
+  return $perms;
 }
 
 /**
Index: modules/statistics/statistics.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v
retrieving revision 1.276
diff -u -p -r1.276 statistics.module
--- modules/statistics/statistics.module	16 Apr 2008 11:35:51 -0000	1.276
+++ modules/statistics/statistics.module	26 Apr 2008 18:44:22 -0000
@@ -69,10 +69,14 @@ function statistics_exit() {
  * Implementation of hook_perm().
  */
 function statistics_perm() {
-  return array(
-    'access statistics' => t('View content access statistics.'),
-    'view post access counter' => t('View the total number of times a piece of content has been accessed.'),
+  $perms = array();
+  $perms['access statistics'] = array(
+    'description' => t('View content access statistics.'),
   );
+  $perms['view post access counter'] = array(
+    'description' => t('View the total number of times a piece of content has been accessed.'),
+  );
+  return $perms;
 }
 
 /**
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.599
diff -u -p -r1.599 system.module
--- modules/system/system.module	23 Apr 2008 20:01:54 -0000	1.599
+++ modules/system/system.module	26 Apr 2008 18:44:27 -0000
@@ -154,15 +154,30 @@ function system_theme() {
  * Implementation of hook_perm().
  */
 function system_perm() {
-  return array(
-    'administer site configuration' => t('Configure site-wide settings such as module or theme administration settings.'),
-    'access administration pages' => t('View the administration panel and browse the help system.'),
-    'administer actions' => t('Manage the actions defined for your site.'),
-    'access site reports' => t('View reports from system logs and other status information.'),
-    'select different theme' => t('Select a theme other than the default theme set by the site administrator.'),
-    'administer files' => t('Manage user-uploaded files.'),
-    'block IP addresses' => t('Block IP addresses from accessing your site.'),
+  $perms = array();
+  $perms['administer site configuration'] = array(
+    'description' => t('Configure site-wide settings such as module or theme administration settings.'),
+    'attributes' => array('security risk'),
+  );
+  $perms['access administration pages'] = array(
+    'description' => t('View the administration panel and browse the help system.'),
+  );
+  $perms['administer actions'] = array(
+    'description' => t('Manage the actions defined for your site.'),
+  );
+  $perms['access site reports'] = array(
+    'description' => t('View reports from system logs and other status information.'),
+  );
+  $perms['select different theme'] = array(
+    'description' => t('Select a theme other than the default theme set by the site administrator.'),
+  );
+  $perms['administer files'] = array(
+    'description' => t('Manage user-uploaded files.'),
+  );
+  $perms['block IP addresses'] = array(
+    'description' => t('Block IP addresses from accessing your site.'),
   );
+  return $perms;
 }
 
 /**
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.419
diff -u -p -r1.419 taxonomy.module
--- modules/taxonomy/taxonomy.module	23 Apr 2008 20:01:54 -0000	1.419
+++ modules/taxonomy/taxonomy.module	26 Apr 2008 18:44:29 -0000
@@ -10,9 +10,11 @@
  * Implementation of hook_perm().
  */
 function taxonomy_perm() {
-  return array(
-    'administer taxonomy' => t('Manage taxonomy vocabularies and terms.'),
+  $perms = array();
+  $perms['administer taxonomy'] = array(
+    'description' => t('Manage taxonomy vocabularies and terms.'),
   );
+  return $perms;
 }
 
 /**
Index: modules/translation/translation.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/translation/translation.module,v
retrieving revision 1.26
diff -u -p -r1.26 translation.module
--- modules/translation/translation.module	14 Apr 2008 17:48:42 -0000	1.26
+++ modules/translation/translation.module	26 Apr 2008 18:44:30 -0000
@@ -86,9 +86,11 @@ function _translation_tab_access($node) 
  * Implementation of hook_perm().
  */
 function translation_perm() {
-  return array(
-    'translate content' => t('Translate website content.'),
+  $perms = array();
+  $perms['translate content'] = array(
+    'description' => t('Translate website content.'),
   );
+  return $perms;
 }
 
 /**
Index: modules/upload/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.200
diff -u -p -r1.200 upload.module
--- modules/upload/upload.module	14 Apr 2008 17:48:43 -0000	1.200
+++ modules/upload/upload.module	26 Apr 2008 18:44:32 -0000
@@ -43,10 +43,14 @@ function upload_theme() {
  * Implementation of hook_perm().
  */
 function upload_perm() {
-  return array(
-    'upload files' => t('Attach images and other files to content.'),
-    'view uploaded files' => t('View and download files attached to content.'),
+  $perms = array();
+  $perms['upload files'] = array(
+    'description' => t('Attach images and other files to content.'),
+  );
+  $perms['view uploaded files'] = array(
+    'description' => t('View and download files attached to content.'),
   );
+  return $perms;
 }
 
 /**
Index: modules/user/user.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.admin.inc,v
retrieving revision 1.21
diff -u -p -r1.21 user.admin.inc
--- modules/user/user.admin.inc	14 Apr 2008 17:48:43 -0000	1.21
+++ modules/user/user.admin.inc	26 Apr 2008 18:44:33 -0000
@@ -500,12 +500,9 @@ function user_admin_perm($form_state, $r
     $result = db_query('SELECT r.rid, p.perm FROM {role} r LEFT JOIN {permission} p ON r.rid = p.rid ORDER BY name');
   }
 
-  // Compile role array:
-  // Add a comma at the end so when searching for a permission, we can
-  // always search for "$perm," to make sure we do not confuse
-  // permissions that are substrings of each other.
+  // Compile array of permissions for each role.
   while ($role = db_fetch_object($result)) {
-    $role_permissions[$role->rid] = $role->perm . ',';
+    $role_permissions[$role->rid] = array_flip(explode(', ', $role->perm));
   }
 
   // Retrieve role names for columns.
@@ -515,39 +512,51 @@ function user_admin_perm($form_state, $r
   }
 
   // Render role/permission overview:
-  $options = array();
   $hide_descriptions = !system_admin_compact_mode();
   foreach (module_list(FALSE, FALSE, TRUE) as $module) {
     if ($permissions = module_invoke($module, 'perm')) {
+      drupal_alter('perm', $permissions, $module, $rid);
       $form['permission'][] = array(
         '#value' => $module,
       );
       ksort($permissions);
-      foreach ($permissions as $perm => $description) {
-        // Account for permissions lacking a description.
-        if (is_int($perm)) {
-          $perm = $description;
-          $description = NULL;
+      foreach ($permissions as $perm => $item) {
+        if (!is_array($item)) {
+          $item = array();
+        }
+        // Mark permissions which have been identified as security risks.
+        if (isset($item['attributes']) && in_array('security risk', $item['attributes'])) {
+          $security_warning = theme('user_perm_security_risk');
+          if (isset($item['description'])) {
+            $item['description'] .= ' ' . $security_warning;
+          }
+          else {
+            $item['description'] = $security_warning;
+          }
+        }
+        if (!isset($item['description'])) {
+          $item['description'] = NULL;
         }
-        $options[$perm] = '';
         $form['permission'][$perm] = array(
           '#type' => 'item',
           '#value' => t($perm),
-          '#description' => $hide_descriptions ? $description : NULL,
+          '#description' => $hide_descriptions ? $item['description'] : NULL,
         );
         foreach ($role_names as $rid => $name) {
-          // Builds arrays for checked boxes for each role
-          if (strpos($role_permissions[$rid], $perm . ',') !== FALSE) {
-            $status[$rid][] = $perm;
+          // Build check boxes for each role
+          $checkbox = array('#type' => 'checkbox', '#title' => '', '#tree' => TRUE);
+          if (isset($role_permissions[$rid][$perm])) {
+            $checkbox['#default_value'] = TRUE;
           }
+          $form['checkboxes'][$rid]['#tree'] = TRUE;
+          $form['checkboxes'][$rid][$perm] = $checkbox;
         }
       }
     }
   }
 
-  // Have to build checkboxes here after checkbox arrays are built
+  // Build list of role names.
   foreach ($role_names as $rid => $name) {
-    $form['checkboxes'][$rid] = array('#type' => 'checkboxes', '#options' => $options, '#default_value' => isset($status[$rid]) ? $status[$rid] : array());
     $form['role_names'][$rid] = array('#value' => $name, '#tree' => TRUE);
   }
   $form['submit'] = array('#type' => 'submit', '#value' => t('Save permissions'));
@@ -825,3 +834,13 @@ function theme_user_filters($form) {
 
   return $output;
 }
+
+/**
+ * Theme the message indicating that a permission represents a security
+ * risk.
+ *
+ * @ingroup themeable
+ */
+function theme_user_perm_security_risk() {
+  return '<em>' . t('Warning: Give to trusted roles only; this permission has security implications.') . '</em>';
+}
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.904
diff -u -p -r1.904 user.module
--- modules/user/user.module	23 Apr 2008 20:01:56 -0000	1.904
+++ modules/user/user.module	26 Apr 2008 18:44:35 -0000
@@ -71,6 +71,10 @@ function user_theme() {
       'arguments' => array('form' => NULL),
       'file' => 'user.admin.inc',
     ),
+    'user_perm_security_risk' => array(
+      'arguments' => array(),
+      'file' => 'user.admin.inc',
+    ),
     'user_signature' => array(
       'arguments' => array('signature' => NULL),
     ),
@@ -499,12 +503,24 @@ function user_is_blocked($name) {
  * Implementation of hook_perm().
  */
 function user_perm() {
-   return array(
-     'administer permissions' => t('Manage the permissions assigned to user roles. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))),
-     'administer users' => t('Manage or block users, and manage their role assignments.'),
-     'access user profiles' => t('View profiles of users on the site, which may contain personal information.'),
-     'change own username' => t('Select a different username.'),
+  $perms = array();
+
+   $perms['administer permissions'] = array(
+     'description' => t('Manage the permissions assigned to user roles.'),
+     'attributes' => array('security risk'),
+   );
+   $perms['administer users'] = array(
+     'description' => t('Manage or block users, and manage their role assignments.'),
+     'attributes' => array('security risk'),
    );
+   $perms['access user profiles'] = array(
+     'description' => t('View profiles of users on the site, which may contain personal information.'),
+   );
+   $perms['change own username'] = array(
+     'description' => t('Select a different username.'),
+   );
+
+   return $perms;
 }
 
 /**
@@ -1864,7 +1880,7 @@ function user_filters() {
   foreach (module_list() as $module) {
     if ($permissions = module_invoke($module, 'perm')) {
       asort($permissions);
-      foreach ($permissions as $permission => $description) {
+      foreach ($permissions as $permission => $item) {
         $options[t('@module module', array('@module' => $module))][$permission] = t($permission);
       }
     }
