當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CCrmPerms::IsAuthorized方法代碼示例

本文整理匯總了PHP中CCrmPerms::IsAuthorized方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCrmPerms::IsAuthorized方法的具體用法?PHP CCrmPerms::IsAuthorized怎麽用?PHP CCrmPerms::IsAuthorized使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CCrmPerms的用法示例。


在下文中一共展示了CCrmPerms::IsAuthorized方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __CrmLeadListEndResonse

    function __CrmLeadListEndResonse($result)
    {
        $GLOBALS['APPLICATION']->RestartBuffer();
        Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
        if (!empty($result)) {
            echo CUtil::PhpToJSObject($result);
        }
        require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_after.php';
        die;
    }
}
if (!CModule::IncludeModule('crm')) {
    __CrmLeadListEndResonse(array('ERROR' => 'Could not include crm module.'));
}
$userPerms = CCrmPerms::GetCurrentUserPermissions();
if (!CCrmPerms::IsAuthorized()) {
    __CrmLeadListEndResonse(array('ERROR' => 'Access denied.'));
}
$action = isset($_REQUEST['ACTION']) ? $_REQUEST['ACTION'] : '';
if (isset($_REQUEST['MODE']) && $_REQUEST['MODE'] === 'SEARCH') {
    if ($userPerms->HavePerm('LEAD', BX_CRM_PERM_NONE, 'READ')) {
        return;
    }
    __IncludeLang(dirname(__FILE__) . '/lang/' . LANGUAGE_ID . '/' . basename(__FILE__));
    CUtil::JSPostUnescape();
    $APPLICATION->RestartBuffer();
    // Limit count of items to be found
    $nPageTop = 50;
    // 50 items by default
    if (isset($_REQUEST['LIMIT_COUNT']) && $_REQUEST['LIMIT_COUNT'] >= 0) {
        $rawNPageTop = (int) $_REQUEST['LIMIT_COUNT'];
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:31,代碼來源:list.ajax.php

示例2: IncludeModuleLangFile

IncludeModuleLangFile(__FILE__);
$err_msg = "";
if ($err_msg == "" && !CModule::IncludeModule('iblock')) {
    $err_msg = "failure\n" . GetMessage('IBLOCK_MODULE_NOT_INSTALLED');
}
if ($err_msg == "" && !CModule::IncludeModule('crm')) {
    $err_msg = "failure\n" . GetMessage('CRM_MODULE_NOT_INSTALLED');
}
if ($err_msg == "" && !CModule::IncludeModule('catalog')) {
    $err_msg = "failure\n" . GetMessage('CATALOG_MODULE_NOT_INSTALLED');
}
if ($err_msg == "" && !CModule::IncludeModule('sale')) {
    $err_msg = "failure\n" . GetMessage('SALE_MODULE_NOT_INSTALLED');
}
$userPerms = CCrmPerms::GetCurrentUserPermissions();
if ($err_msg == "" && !CCrmPerms::IsAuthorized()) {
    $err_msg = "failure.\n" . GetMessage('CRM_EXCH1C_AUTH_ERROR');
}
$crmPerms = new CCrmPerms($GLOBALS["USER"]->GetID());
if ($err_msg == "" && !CCrmPerms::IsAdmin() && !$crmPerms->HavePerm('CONFIG', BX_CRM_PERM_CONFIG, 'WRITE')) {
    $err_msg = "failure.\n" . GetMessage('CRM_EXCH1C_PERMISSION_DENIED');
}
$type = isset($_REQUEST["type"]) ? $_REQUEST["type"] : "";
if ($err_msg == "" && !in_array($type, array("sale", "catalog", "get_catalog"), true)) {
    $err_msg = "failure.\n" . GetMessage('CRM_EXCH1C_UNKNOWN_COMMAND_TYPE');
}
if ($err_msg != "") {
    $APPLICATION->RestartBuffer();
    echo $err_msg;
    return;
}
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:31,代碼來源:1c_exchange.php


注:本文中的CCrmPerms::IsAuthorized方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。