function block_access_user_access in Block Access 6
Same name and namespace in other branches
- 6.2 block_access.module \block_access_user_access()
- 7 block_access.module \block_access_user_access()
11 calls to block_access_user_access()
File
- ./
block_access.module, line 133
Code
function block_access_user_access($module, $delta, $perm) {
global $user;
static $perms = array();
if (!isset($perms[$module])) {
$perms[$module] = array(
$delta => array(),
);
}
if (!isset($perms[$module][$delta])) {
$perms[$module][$delta] = array();
}
if (!isset($perms[$module][$delta][$perm])) {
$perms[$module][$delta][$perm] = false;
foreach (block_access_get_roles($module, $perm, $delta) as $rid) {
if (in_array($rid, array_keys($user->roles))) {
$perms[$module][$delta][$perm] = true;
break;
}
}
}
return $perms[$module][$delta][$perm];
}