当前位置: 首页>>代码示例>>PHP>>正文


PHP CMbObject::filterByPerm方法代码示例

本文整理汇总了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();
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:ajax_img_to_document.php

示例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;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:32,代码来源:CMediusers.class.php


注:本文中的CMbObject::filterByPerm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。