--- forum_access/forum_access.admin.inc	2011-11-19 03:38:52.000000000 +0100
+++ forum_access_new/forum_access.admin.inc	2011-11-20 20:18:21.511718800 +0100
@@ -860,6 +860,50 @@ function _forum_access_get_settings($tid
  */
 function _forum_access_forum_overview(&$form, &$form_state) {
   global $user;
+
+  $form['#theme'] = 'forum_access_forum_overview';
+  $administer = array();
+  $user_roles = user_roles();
+  foreach ($user_roles as $rid => $role) {
+    $permissions = user_role_permissions(array($rid => $rid));
+    $administer[$rid] = array_key_exists('administer comments', $permissions[$rid]);
+  }
+  $path = drupal_get_path('module', 'forum_access') .'/icons/';
+  foreach ($form as $key => $value) {
+    if (preg_match('#^tid:(.*):0$#', $key, $matches)) {
+      $tid = $form[$key]['tid']['#value'];
+      $grants = _forum_access_get_settings($tid);
+      $grants_list = array();
+      foreach ($user_roles as $rid => $role) {
+        if (in_array($rid, $grants['delete']) || $administer[$rid]) {
+          $grants_list[$rid] = theme('image', array('path' => $path .'delete.png', 'width' => 16, 'height' => 16, 'alt' => 'delete', 'title' => 'delete'));
+        }
+        else if (in_array($rid, $grants['update']) || $administer[$rid]) {
+          $grants_list[$rid] = theme('image', array('path' => $path .'update.png', 'width' => 16, 'height' => 16, 'alt' => 'update', 'title' => 'update'));
+        }
+        else if (in_array($rid, $grants['create'])) {
+          $grants_list[$rid] = theme('image', array('path' => $path .'create.png', 'width' => 16, 'height' => 16, 'alt' => 'create', 'title' => 'create'));
+        }
+        else if (in_array($rid, $grants['view'])) {
+          $grants_list[$rid] = theme('image', array('path' => $path .'view.png', 'width' => 16, 'height' => 16, 'alt' => 'view', 'title' => 'view'));
+        }
+        else {
+          $grants_list[$rid] = theme('image', array('path' => $path .'none.png', 'width' => 16, 'height' => 16, 'alt' => 'none', 'title' => 'none'));
+        }
+      }
+
+      $rights = array();
+      foreach ($grants_list as $rid => $right) {
+        $rights[] = $user_roles[$rid] .' '. $right;
+      }
+
+      $form[$key]['rights'] = array(
+        '#type' => 'item',
+        '#markup' => implode(' ', $rights),
+        );
+    }
+  }
+
   if (user_access('bypass node access', $user)) {
     return;
   }
@@ -902,3 +946,96 @@ function _forum_access_content_access_ad
   }
 }
 
+/**
+ * Returns HTML for a terms overview form as a sortable list of terms. Builds on theme_taxonomy_overview_terms(). Changes marked by /***.
+ *
+ * @param $variables
+ *   An associative array containing:
+ *   - form: A render element representing the form.
+ *
+ * @see theme_taxonomy_overview_terms()
+ * @ingroup themeable
+ */
+function theme_forum_access_forum_overview($variables) {
+  $form = $variables['form'];
+
+  $page_increment  = $form['#page_increment'];
+  $page_entries    = $form['#page_entries'];
+  $back_step     = $form['#back_step'];
+  $forward_step  = $form['#forward_step'];
+
+  // Add drag and drop if parent fields are present in the form.
+  if ($form['#parent_fields']) {
+    drupal_add_tabledrag('taxonomy', 'match', 'parent', 'term-parent', 'term-parent', 'term-id', FALSE);
+    drupal_add_tabledrag('taxonomy', 'depth', 'group', 'term-depth', NULL, NULL, FALSE);
+    drupal_add_js(drupal_get_path('module', 'taxonomy') . '/taxonomy.js');
+    drupal_add_js(array('taxonomy' => array('backStep' => $back_step, 'forwardStep' => $forward_step)), 'setting');
+    drupal_add_css(drupal_get_path('module', 'taxonomy') . '/taxonomy.css');
+  }
+  drupal_add_tabledrag('taxonomy', 'order', 'sibling', 'term-weight');
+
+  $errors = form_get_errors() != FALSE ? form_get_errors() : array();
+  $rows = array();
+  foreach (element_children($form) as $key) {
+    if (isset($form[$key]['#term'])) {
+      $term = &$form[$key];
+
+      $row = array();
+      $row[] = (isset($term['#term']['depth']) && $term['#term']['depth'] > 0 ? theme('indentation', array('size' => $term['#term']['depth'])) : ''). drupal_render($term['view']);
+      if ($form['#parent_fields']) {
+        $term['tid']['#attributes']['class'] = array('term-id');
+        $term['parent']['#attributes']['class'] = array('term-parent');
+        $term['depth']['#attributes']['class'] = array('term-depth');
+        $row[0] .= drupal_render($term['parent']) . drupal_render($term['tid']) . drupal_render($term['depth']);
+      }
+      $term['weight']['#attributes']['class'] = array('term-weight');
+      $row[] = drupal_render($term['weight']);
+      $row[] = drupal_render($term['rights']); //***
+      $row[] = drupal_render($term['edit']);
+      $row = array('data' => $row);
+      $rows[$key] = $row;
+    }
+  }
+
+  // Add necessary classes to rows.
+  $row_position = 0;
+  foreach ($rows as $key => $row) {
+    $rows[$key]['class'] = array();
+    if (isset($form['#parent_fields'])) {
+      $rows[$key]['class'][] = 'draggable';
+    }
+
+    // Add classes that mark which terms belong to previous and next pages.
+    if ($row_position < $back_step || $row_position >= $page_entries - $forward_step) {
+      $rows[$key]['class'][] = 'taxonomy-term-preview';
+    }
+
+    if ($row_position !== 0 && $row_position !== count($rows) - 1) {
+      if ($row_position == $back_step - 1 || $row_position == $page_entries - $forward_step - 1) {
+        $rows[$key]['class'][] = 'taxonomy-term-divider-top';
+      }
+      elseif ($row_position == $back_step || $row_position == $page_entries - $forward_step) {
+        $rows[$key]['class'][] = 'taxonomy-term-divider-bottom';
+      }
+    }
+
+    // Add an error class if this row contains a form error.
+    foreach ($errors as $error_key => $error) {
+      if (strpos($error_key, $key) === 0) {
+        $rows[$key]['class'][] = 'error';
+      }
+    }
+    $row_position++;
+  }
+
+  if (empty($rows)) {
+    $rows[] = array(array('data' => $form['#empty_text'], 'colspan' => '3'));
+  }
+
+  $header = array(t('Name'), t('Weight'), t('Rights'), t('Operations'));
+  $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'taxonomy')));
+  $output .= drupal_render_children($form);
+  $output .= theme('pager');
+
+  return $output;
+}
