本文整理汇总了PHP中CCrmPerms::CheckEnityAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmPerms::CheckEnityAccess方法的具体用法?PHP CCrmPerms::CheckEnityAccess怎么用?PHP CCrmPerms::CheckEnityAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmPerms
的用法示例。
在下文中一共展示了CCrmPerms::CheckEnityAccess方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$bExport = !$CrmPerms->HavePerm('INVOICE', BX_CRM_PERM_NONE, 'EXPORT');
$bImport = !$CrmPerms->HavePerm('INVOICE', BX_CRM_PERM_NONE, 'IMPORT');
$bAdd = !$CrmPerms->HavePerm('INVOICE', BX_CRM_PERM_NONE, 'ADD');
$bWrite = !$CrmPerms->HavePerm('INVOICE', BX_CRM_PERM_NONE, 'WRITE');
$bDelete = false;
} else {
$arFields = CCrmInvoice::GetByID($arParams['ELEMENT_ID']);
$arEntityAttr[$arParams['ELEMENT_ID']] = array();
if ($arFields !== false) {
$arEntityAttr = $CrmPerms->GetEntityAttr('INVOICE', array($arParams['ELEMENT_ID']));
}
$bRead = $arFields !== false;
$bExport = false;
$bImport = false;
$bAdd = !$CrmPerms->HavePerm('INVOICE', BX_CRM_PERM_NONE, 'ADD');
$bWrite = $CrmPerms->CheckEnityAccess('INVOICE', 'WRITE', $arEntityAttr[$arParams['ELEMENT_ID']]);
$bDelete = $CrmPerms->CheckEnityAccess('INVOICE', 'DELETE', $arEntityAttr[$arParams['ELEMENT_ID']]);
}
if (!$bRead && !$bAdd && !$bWrite) {
return false;
}
if ($arParams['TYPE'] === 'list') {
if ($bAdd) {
$arResult['BUTTONS'][] = array('TEXT' => GetMessage('INVOICE_ADD'), 'TITLE' => GetMessage('INVOICE_ADD_TITLE'), 'LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_INVOICE_EDIT'], array('invoice_id' => 0)), 'HIGHLIGHT' => true);
}
// if ($bImport)
// {
// $arResult['BUTTONS'][] = array(
// 'TEXT' => GetMessage('INVOICE_IMPORT'),
// 'TITLE' => GetMessage('INVOICE_IMPORT_TITLE'),
// 'LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_INVOICE_IMPORT'], array()),
示例2: GetMessage
$arResult['ENTITY_TITLE'] = GetMessage('CRM_EVENT_DEFAULT_TITLE');
$arResult['EVENT_TYPE'] = $arParams['EVENT_TYPE'];
$arResult['FREEZE_EVENT_ID'] = isset($arParams['FREEZE_EVENT_ID']) ? strtoupper($arParams['FREEZE_EVENT_ID']) : '';
if ($arParams['EVENT_TYPE'] === 'PHONE') {
$arResult['PHONE_GROUPS'] = array();
}
switch ($arParams['ENTITY_TYPE']) {
case 'LEAD':
$dbRes = CCrmLead::GetList(array('TITLE' => 'ASC', 'LAST_NAME' => 'ASC', 'NAME' => 'ASC'), array('ID' => $arResult['ENTITY_ID']));
if ($arRes = $dbRes->Fetch()) {
$arResult['ENTITY_TITLE'] = $arRes['TITLE'];
$arResult['STATUS_ID'] = $arRes['STATUS_ID'];
$arResult['ENTITY_CONVERTED'] = $arRes['STATUS_ID'] == 'CONVERTED' ? 'Y' : 'N';
}
$arEntityAttr = $CCrmPerms->GetEntityAttr('LEAD', $arResult['ENTITY_ID']);
if ($CCrmPerms->CheckEnityAccess('LEAD', 'WRITE', $arEntityAttr[$arResult['ENTITY_ID']])) {
$arResult['STATUS_LIST'] = array();
$arResult['STATUS_LIST_EX'] = CCrmStatus::GetStatusList('STATUS');
foreach ($arResult['STATUS_LIST_EX'] as $key => $value) {
if ($key == 'CONVERTED') {
continue;
}
if ($CCrmPerms->GetPermType('LEAD', 'WRITE', array('STATUS_ID' . $key)) > BX_CRM_PERM_NONE) {
$arResult['STATUS_LIST']['REFERENCE'][] = $value;
$arResult['STATUS_LIST']['REFERENCE_ID'][] = $key;
}
}
$arResult['PHONE_GROUPS'][] = array('PHONES' => __CrmEventGetPhones('LEAD', $arResult['ENTITY_ID']));
}
break;
case 'CONTACT':