function block_access_user_access in Block Access 7
Same name and namespace in other branches
- 6.2 block_access.module \block_access_user_access()
- 6 block_access.module \block_access_user_access()
17 calls to block_access_user_access()
File
- ./
block_access.module, line 152
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;
module_load_include('inc', 'block_access', 'block_access.db');
$roles = block_access_get_roles($module, $perm, $delta);
foreach ($roles as $rid) {
if (in_array($rid, array_keys($user->roles))) {
$perms[$module][$delta][$perm] = TRUE;
break;
}
}
}
return $perms[$module][$delta][$perm];
}