本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}