本文整理汇总了PHP中CMbObject::filterByPerm方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbObject::filterByPerm方法的具体用法?PHP CMbObject::filterByPerm怎么用?PHP CMbObject::filterByPerm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbObject
的用法示例。
在下文中一共展示了CMbObject::filterByPerm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
}
}
}
$sejours = $patient->loadRefsSejours();
CMbObject::filterByPerm($sejours, PERM_READ);
foreach ($sejours as $_sejour) {
$_sejour->loadRefsFiles();
foreach ($_sejour->_ref_files as $_key => $_file) {
$right = $_file->canDo();
if (!$_file->isImage() || !$_file->_can->read || $_file->annule) {
unset($_sejour->_ref_files[$_key]);
continue;
}
}
$operations = $_sejour->loadRefsOperations();
CMbObject::filterByPerm($operations);
foreach ($operations as $_op) {
$_op->loadRefsFiles();
foreach ($_op->_ref_files as $_key => $_file) {
$right = $_file->canDo();
if (!$_file->isImage() || !$_file->_can->read || $_file->annule) {
unset($_op->_ref_files[$_key]);
continue;
}
}
}
}
// file categories
$category = new CFilesCategory();
$categories = $category->loadListWithPerms(PERM_EDIT);
$matrices = array();
示例2: loadFonctions
/**
* Load functions with permissions for given group, current group by default
*
* @param int $permType Level of permission
* @param int $group_id Filter on group
* @param string $type Type of function
*
* @return CFunctions[] Found functions
*/
static function loadFonctions($permType = PERM_READ, $group_id = null, $type = null, $name = "")
{
$group = CGroups::loadCurrent();
$function = new CFunctions();
$where = array();
$where["actif"] = "= '1'";
$where["group_id"] = "= '" . CValue::first($group_id, $group->_id) . "'";
if ($type) {
$where["type"] = "= '{$type}'";
}
if ($name) {
$where["text"] = "LIKE '{$name}%'";
}
$order = "text";
/** @var CFunctions[] $functions */
$functions = $function->loadList($where, $order);
CMbObject::filterByPerm($functions, $permType);
// Group association
foreach ($functions as $function) {
$function->_ref_group = $group;
}
return $functions;
}