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