--- blog_list/blog_list.module	2008-02-26 23:08:23.000000000 +0100
+++ blog_list.module	2008-07-31 07:39:54.000000000 +0200
@@ -7,6 +7,13 @@
  */
 
 /**
+ * Permissions
+ */
+function blog_list_perm() {
+  return array('access blog list');
+}
+
+/**
  * Provide a "blogs" menu item that links
  * to the list of blogs.
  *
@@ -20,7 +27,7 @@ function blog_list_menu($may_cache) {
   if ($may_cache) {
     $items[] = array('path' => 'blogs', 'title' => t('Blogs'),
       'callback' => 'blog_list_blog_list',
-      'access' => user_access('access content'),
+      'access' => user_access('access blog list'),
       'type' => MENU_SUGGESTED_ITEM);
   }
   return $items;
@@ -34,24 +41,24 @@ function blog_list_menu($may_cache) {
  */
 function blog_list_blog_list() {
   global $user;
-
-  $output = '<table class="blog-list">' .
-            '<thead><tr><th>User</th></tr></thead>' .
-            '<tbody>';
-
-  $result = pager_query(db_rewrite_sql("SELECT DISTINCT u.name, u.uid FROM {users} u INNER JOIN {node} n ON u.uid = n.uid WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), variable_get('default_nodes_main', 10));
-
-  $odd = TRUE;
-  while ($row = db_fetch_array($result)) {
-    $output .= '<tr class="' . ($odd ? 'odd' : 'even') . '">' .
-               '<td>' . l($row['name'], 'blog/' . $row['uid']) . '</td>' .
-    		   '</tr>';
-    $odd = !$odd;
+  if (user_access('access blog list')) {
+      $output = '<table class="blog-list">' .
+                '<thead><tr><th>User</th></tr></thead>' .
+                '<tbody>';
+
+      $result = pager_query(db_rewrite_sql("SELECT DISTINCT u.name, u.uid FROM {users} u INNER JOIN {node} n ON u.uid = n.uid WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), variable_get('default_nodes_main', 10));
+
+      $odd = TRUE;
+      while ($row = db_fetch_array($result)) {
+        $output .= '<tr class="' . ($odd ? 'odd' : 'even') . '">' .
+                   '<td>' . l($row['name'], 'blog/' . $row['uid']) . '</td>' .
+                   '</tr>';
+        $odd = !$odd;
+      }
+      $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
+      
+      $output .= '</tbody>' .
+                 '</table>';
   }
-  $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
-  
-  $output .= '</tbody>' .
-             '</table>';
-
   return $output;
 }
