回答

4

通过user_access检查访问('某个访问名');
对于您的模块,只需返回空值,并且该块不会为该用户显示。
对于块管理,请使用php代码进行查看。

3

Nikit是正确的,一个代码的例子是:

<?php 

$block = array(); 
if (user_access('my custom permission')) { 
    $block['content'] = t('Here is a message'); 
} 
return $block; 

?> 
相关问题