How to show a block only if a specific user is logged in? I have a block which act as a menu. And the block is created dynamically like that: 

$menu_block = array(
    'module' =&gt; 'menu',
    'delta' =&gt; 'clientmenu' . $account-&gt;uid, // the id of the block
    'theme' =&gt; 'MYTHEME', // the current theme
    'title' =&gt; '&lt;none&gt;', // dispaly no title
    'visibility' =&gt; 1, // it is displayed only on those pages listed in $block-&gt;pages.
    'region' =&gt; 'menu',
    'status' =&gt; 1,
    'pages' =&gt; $onlythispages, // display the menu only for this client
);

drupal_write_record('block', $menu_block);


And content of the variable $onlythispages is:

// page to display the menu
$onlythispages = 'client/' . $account-&gt;name . '
client/' . $account-&gt;name . '/*' . '
all-products
product/*';


I created one menu for each created user. Each user has personal (only he can access) pages like: 

client/' . $account-&gt;name 
client/' . $account-&gt;name . '/*'


And each user has some common pages which share with all users, pages like:

all-products
product/* 


So the problem is that when I go to common pages I see all the "menu blocks" from all the users. So is there a way to show a block only if a specific user id, which actually is the currently logged in user?

I use hook_node_access to handle the access to a node but, how can I do it handle the access to block?
If only a block needs to be shown for each user, then what I would do is to implement the block in a module that changes the content of the block basing on the currently logged-in user. The visibility settings are also used for blocks implemented by third-party modules.