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


PHP CCrmPerms::CheckEnityAccess方法代码示例

本文整理汇总了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()),
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例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':
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php


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