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


PHP CIntranetUtils::GetDepartmentColleagues方法代码示例

本文整理汇总了PHP中CIntranetUtils::GetDepartmentColleagues方法的典型用法代码示例。如果您正苦于以下问题:PHP CIntranetUtils::GetDepartmentColleagues方法的具体用法?PHP CIntranetUtils::GetDepartmentColleagues怎么用?PHP CIntranetUtils::GetDepartmentColleagues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIntranetUtils的用法示例。


在下文中一共展示了CIntranetUtils::GetDepartmentColleagues方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetAccess

 public static function GetAccess()
 {
     global $USER;
     // simplest caching. is it enough? maybe...
     static $access = null;
     if (!is_array($access)) {
         $access = array('READ' => array(), 'WRITE' => array());
         $arAccessSettings = null;
         if ($USER->CanDoOperation('tm_read')) {
             $access['READ'][] = '*';
         } elseif ($USER->CanDoOperation('tm_read_subordinate')) {
             $arAccessSettings = self::GetAccessSettings();
             if ($arAccessSettings['READ']['EMPLOYEE'] >= 2) {
                 $access['READ'][] = '*';
             } else {
                 // everybody can read his own entries
                 $access['READ'][] = $USER->GetID();
                 if ($arAccessSettings['READ']['EMPLOYEE'] >= 1) {
                     $dbUsers = CIntranetUtils::GetDepartmentColleagues();
                     while ($arRes = $dbUsers->Fetch()) {
                         $access['READ'][] = $arRes['ID'];
                     }
                 }
                 $dbUsers = CIntranetUtils::GetSubordinateEmployees($USER->GetID(), $arAccessSettings['READ']['HEAD'] == 1);
                 while ($arRes = $dbUsers->Fetch()) {
                     if ($arAccessSettings['READ']['HEAD'] == 2) {
                         $access['READ'] = array('*');
                         break;
                     }
                     $access['READ'][] = $arRes['ID'];
                 }
                 $access['READ'] = array_values(array_unique($access['READ']));
             }
         }
         if ($USER->CanDoOperation('tm_write')) {
             $access['WRITE'][] = '*';
         } elseif ($USER->CanDoOperation('tm_write_subordinate')) {
             if ($arAccessSettings['WRITE']['EMPLOYEE'] >= 2) {
                 $access['WRITE'][] = '*';
             } else {
                 // check if current user is The Boss.
                 $arManagers = self::GetUserManagers($USER->GetID());
                 if (count($arManagers) == 1 && $arManagers[0] == $USER->GetID()) {
                     $access['WRITE'][] = $USER->GetID();
                 }
                 if (!is_array($arAccessSettings)) {
                     $arAccessSettings = self::GetAccessSettings();
                 }
                 $dbUsers = CIntranetUtils::GetSubordinateEmployees($USER->GetID(), $arAccessSettings['WRITE']['HEAD'] == 1);
                 while ($arRes = $dbUsers->Fetch()) {
                     $access['WRITE'][] = $arRes['ID'];
                 }
                 $access['WRITE'] = array_values(array_unique($access['WRITE']));
             }
         }
     }
     return $access;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:58,代码来源:timeman.php


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