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


PHP CMain::GetUserRight方法代码示例

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


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

示例1: UnLock

 function UnLock($ID)
 {
     global $DB;
     $ID = IntVal($ID);
     if ($ID <= 0) {
         return False;
     }
     $arOrder = CSaleOrder::GetByID($ID);
     if (!$arOrder) {
         return False;
     }
     $userRights = CMain::GetUserRight("sale", $GLOBALS["USER"]->GetUserGroupArray(), "Y", "Y");
     if ($userRights >= "W" || $arOrder["LOCKED_BY"] == $GLOBALS["USER"]->GetID()) {
         $arFields = array("DATE_LOCK" => false, "LOCKED_BY" => false);
         if (!CSaleOrder::Update($ID, $arFields, false)) {
             return False;
         } else {
             return True;
         }
     }
     return False;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:22,代码来源:order.php

示例2: getStatusesGroupCanDoOperations

 static function getStatusesGroupCanDoOperations($groupId, array $operations)
 {
     $statuses = array();
     if (!is_array($groupId)) {
         $groupId = array($groupId);
     }
     if (in_array('1', $groupId, true) || \CMain::GetUserRight('sale', $groupId) >= 'W') {
         $statuses = self::getAllStatuses();
     } else {
         $operations = self::convertNamesToOperations($operations);
         $result = StatusTable::getList(array('select' => array('ID', 'OPERATION' => 'Bitrix\\Sale\\Internals\\StatusGroupTaskTable:STATUS.TASK.Bitrix\\Main\\TaskOperation:TASK.OPERATION.NAME'), 'filter' => array('=TYPE' => static::TYPE, '=Bitrix\\Sale\\Internals\\StatusGroupTaskTable:STATUS.GROUP_ID' => $groupId, '=Bitrix\\Sale\\Internals\\StatusGroupTaskTable:STATUS.TASK.Bitrix\\Main\\TaskOperation:TASK.OPERATION.NAME' => $operations), 'order' => array('SORT')));
         while ($row = $result->fetch()) {
             if ($status =& $statuses[$row['ID']]) {
                 $status[] = $row['OPERATION'];
             } else {
                 $status = array($row['OPERATION']);
             }
         }
         unset($status);
         foreach ($statuses as $id => $ops) {
             if (array_diff($operations, $ops)) {
                 unset($statuses[$id]);
             }
         }
         $statuses = array_keys($statuses);
     }
     return $statuses;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:28,代码来源:status.php

示例3: GetGroupRight

 function GetGroupRight($module_id, $arGroups = false, $use_default_level = "Y", $max_right_for_super_admin = "Y", $site_id = false)
 {
     return CMain::GetUserRight($module_id, $arGroups, $use_default_level, $max_right_for_super_admin, $site_id);
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:4,代码来源:main.php

示例4: UnLock

 public static function UnLock($ID)
 {
     $ID = IntVal($ID);
     if ($ID <= 0) {
         return False;
     }
     $arOrder = CSaleOrder::GetByID($ID);
     if (!$arOrder) {
         return False;
     }
     $userRights = CMain::GetUserRight("sale", $GLOBALS["USER"]->GetUserGroupArray(), "Y", "Y");
     if ($userRights >= "W" || $arOrder["LOCKED_BY"] == $GLOBALS["USER"]->GetID()) {
         $arFields = array("DATE_LOCK" => false, "LOCKED_BY" => false);
         if (!Sale\Internals\OrderTable::update($ID, $arFields)) {
             return False;
         } else {
             return True;
         }
     }
     return False;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:21,代码来源:order.php


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