--- admin.module-6.x-2.0	2010-10-25 12:22:42.000000000 +0200
+++ admin.module	2010-10-25 12:40:52.000000000 +0200
@@ -388,6 +388,18 @@ function admin_set_admin_blocks($reset =
           $block->region = 'admin_toolbar'; // Fake the block region.
         }
         if (!empty($block)) {
+          // Get allowed rids for this block.
+          $result = db_query("SELECT rid FROM {blocks_roles} WHERE module = '%s' AND delta = '%s'", $module, $delta);
+          $block_rids = array();
+          while ($rid = db_result($result)) {
+            $block_rids[] = $rid;
+          }
+          // Don't display the block if it is restricted to role(s) 
+          // and the current user does not belong to one of the roles.
+          // User 1 will see the block anyway.
+          if (count($block_rids) && !count(array_intersect($block_rids, array_keys($GLOBALS['user']->roles))) && $GLOBALS['user']->uid != 1) {
+            continue;
+          }
           if ($_SERVER['REQUEST_METHOD'] == 'GET' && $cid = admin_block_get_cache_id($block)) {
             if ($cache = cache_get($cid, 'cache_block')) {
               $array = $cache->data;
