本文整理汇总了PHP中ACLController::checkModuleAllowed方法的典型用法代码示例。如果您正苦于以下问题:PHP ACLController::checkModuleAllowed方法的具体用法?PHP ACLController::checkModuleAllowed怎么用?PHP ACLController::checkModuleAllowed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACLController
的用法示例。
在下文中一共展示了ACLController::checkModuleAllowed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filterModuleList
function filterModuleList(&$moduleList, $by_value = true)
{
global $aclModuleList, $current_user;
if (is_admin($current_user)) {
return;
}
$actions = ACLAction::getUserActions($current_user->id, false);
$compList = array();
if ($by_value) {
foreach ($moduleList as $key => $value) {
$compList[$value] = $key;
}
} else {
$compList =& $moduleList;
}
foreach ($actions as $action_name => $action) {
if (!empty($action['module'])) {
$aclModuleList[$action_name] = $action_name;
if (isset($compList[$action_name])) {
if ($action['module']['access']['aclaccess'] < ACL_ALLOW_ENABLED) {
if ($by_value) {
unset($moduleList[$compList[$action_name]]);
} else {
unset($moduleList[$action_name]);
}
}
}
}
}
if (isset($compList['Calendar']) && !(ACLController::checkModuleAllowed('Calls', $actions) || ACLController::checkModuleAllowed('Meetings', $actions) || ACLController::checkModuleAllowed('Tasks', $actions))) {
if ($by_value) {
unset($moduleList[$compList['Calendar']]);
} else {
unset($moduleList['Calendar']);
}
if (isset($compList['Activities']) && !(ACLController::checkModuleAllowed('Notes', $actions) || ACLController::checkModuleAllowed('Notes', $actions))) {
if ($by_value) {
unset($moduleList[$compList['Activities']]);
} else {
unset($moduleList['Activities']);
}
}
}
}