Index: modules/user/user.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.css,v
retrieving revision 1.1
diff -u -F^f -r1.1 user.css
--- modules/user/user.css	14 Aug 2006 07:14:50 -0000	1.1
+++ modules/user/user.css	15 Aug 2006 19:13:06 -0000
@@ -1,11 +1,20 @@
 /* $Id: user.css,v 1.1 2006/08/14 07:14:50 drumm Exp $ */
 
-#permissions td.module {
+#permissions tbody th {
+  padding-top: 0.5em;
+  background: #fff;
+  font-weight: normal;
+  border-bottom-width: 1px;
+  color: #666;
+}
+#permissions tbody th.module {
   font-weight: bold;
+  color: #000;
 }
 #permissions td.permission {
   padding-left: 1.5em;
 }
+
 #access-rules .access-type, #access-rules .rule-type {
   margin-right: 1em;
   float: left;
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.653
diff -u -F^f -r1.653 user.module
--- modules/user/user.module	14 Aug 2006 20:35:11 -0000	1.653
+++ modules/user/user.module	15 Aug 2006 19:13:07 -0000
@@ -1729,21 +1729,8 @@ function user_roles($membersonly = 0, $p
 /**
  * Menu callback: administer permissions.
  */
-function user_admin_perm($str_rids = NULL) {
-  if (preg_match('/^([0-9]+[+ ])*[0-9]+$/', $str_rids)) {
-    // The '+' character in a query string may be parsed as ' '.
-    $rids = preg_split('/[+ ]/', $str_rids);
-  }
-
-  if($rids) {
-    $breadcrumbs = drupal_get_breadcrumb();
-    $breadcrumbs[] = l(t('all roles'), 'admin/user/access');
-    drupal_set_breadcrumb($breadcrumbs);
-    $result = db_query('SELECT r.rid, p.perm FROM {role} r LEFT JOIN {permission} p ON r.rid = p.rid WHERE r.rid IN (%s) ORDER BY name', implode(', ', $rids));
-  }
-  else {
-    $result = db_query('SELECT r.rid, p.perm FROM {role} r LEFT JOIN {permission} p ON r.rid = p.rid ORDER BY name');
-  }
+function user_admin_perm() {
+  $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:
   $roles = array();
@@ -1751,12 +1738,7 @@ function user_admin_perm($str_rids = NUL
     $role_permissions[$role->rid] = $role->perm;
   }
 
-  if($rids) {
-    $result = db_query('SELECT rid, name FROM {role} r WHERE r.rid IN (%s) ORDER BY name', implode(', ', $rids));
-  }
-  else {
-    $result = db_query('SELECT rid, name FROM {role} ORDER BY name');
-  }
+  $result = db_query('SELECT rid, name FROM {role} ORDER BY name');
   $role_names = array();
   while ($role = db_fetch_object($result)) {
     $role_names[$role->rid] = $role->name;
@@ -1766,11 +1748,11 @@ function user_admin_perm($str_rids = NUL
   $options = array();
   foreach (module_list(FALSE, FALSE, TRUE) as $module) {
     if ($permissions = module_invoke($module, 'perm')) {
-      $form['permission'][] = array('#type' => 'markup', '#value' => t('%module module', array('%module' => $module)));
+      $form['permission'][] = array('#value' => t('%module module', array('%module' => $module)));
       asort($permissions);
       foreach ($permissions as $perm) {
         $options[$perm] = '';
-        $form['permission'][$perm] = array('#type' => 'markup', '#value' => t($perm));
+        $form['permission'][$perm] = array('#value' => t($perm));
         foreach ($role_names as $rid => $name) {
           // Builds arrays for checked boxes for each role
           if (strstr($role_permissions[$rid], $perm)) {
@@ -1783,7 +1765,7 @@ function user_admin_perm($str_rids = NUL
   // Have to build checkboxes here after checkbox arrays are built
   foreach ($role_names as $rid => $name) {
     $form['checkboxes'][$rid] = array('#type' => 'checkboxes', '#options' => $options, '#default_value' => $status[$rid]);
-    $form['role_names'][$rid] = array('#type' => 'markup', '#value' => l($name, 'admin/user/access/'. $rid), '#tree' => TRUE);
+    $form['role_names'][$rid] = array('#value' => $name, '#tree' => TRUE);
   }
   $form['submit'] = array('#type' => 'submit', '#value' => t('Save permissions'));
 
@@ -1791,16 +1773,31 @@ function user_admin_perm($str_rids = NUL
 }
 
 function theme_user_admin_perm($form) {
+  $header = array(t('Permission'));
+  $roles = array();
+  foreach (element_children($form['role_names']) as $rid) {
+    if (is_array($form['role_names'][$rid])) {
+      $roles[] = array('data' => drupal_render($form['role_names'][$rid]), 'header' => TRUE);
+    }
+  }
+  $header = array_merge($header, $roles);
+
   foreach (element_children($form['permission']) as $key) {
     // Don't take form control structures
     if (is_array($form['permission'][$key])) {
       $row = array();
-      // Module name
       if (is_numeric($key)) {
-        $row[] = array('data' => drupal_render($form['permission'][$key]), 'class' => 'module', 'colspan' => count($form['role_names']) + 1);
-      // Permissions
+        // Module name
+        $row[] = array('data' => drupal_render($form['permission'][$key]), 'header' => TRUE, 'class' => 'module');
+        if ($key % 3 == 2) {
+          $row = array_merge($row, $roles);
+        }
+        else {
+          $row[0]['colspan'] = count($roles) + 1;
+        }
       }
       else {
+        // Permissions
         $row[] = array('data' => drupal_render($form['permission'][$key]), 'class' => 'permission');
         foreach (element_children($form['checkboxes']) as $rid) {
           if (is_array($form['checkboxes'][$rid])) {
@@ -1811,12 +1808,6 @@ function theme_user_admin_perm($form) {
       $rows[] = $row;
     }
   }
-  $header[] = (t('Permission'));
-  foreach (element_children($form['role_names']) as $rid) {
-    if (is_array($form['role_names'][$rid])) {
-      $header[] = drupal_render($form['role_names'][$rid]);
-    }
-  }
   $output = theme('table', $header, $rows, array('id' => 'permissions'));
   $output .= drupal_render($form);
   return $output;
@@ -1826,26 +1817,23 @@ function user_admin_perm_submit($form_id
   // Save permissions:
   $result = db_query('SELECT * FROM {role}');
   while ($role = db_fetch_object($result)) {
-    if(isset($edit[$role->rid])) {
-      // Delete, so if we clear every checkbox we reset that role;
-      // otherwise permissions are active and denied everywhere.
-      db_query('DELETE FROM {permission} WHERE rid = %d', $role->rid);
-      foreach ($edit[$role->rid] as $key => $value) {
-        if (!$value) {
-          unset($edit[$role->rid][$key]);
-        }
-      }
-      if (count($edit[$role->rid])) {
-        db_query("INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')", $role->rid, implode(', ', array_keys($edit[$role->rid])));
+    // Delete, so if we clear every checkbox we reset that role;
+    // otherwise permissions are active and denied everywhere.
+    db_query('DELETE FROM {permission} WHERE rid = %d', $role->rid);
+    foreach ($edit[$role->rid] as $key => $value) {
+      if (!$value) {
+        unset($edit[$role->rid][$key]);
       }
     }
+    if (count($edit[$role->rid])) {
+      db_query("INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')", $role->rid, implode(', ', array_keys($edit[$role->rid])));
+    }
   }
 
   drupal_set_message(t('The changes have been saved.'));
 
   // Clear the cached pages and menus:
   menu_rebuild();
-
 }
 
 /**
