本文整理汇总了PHP中CCrmOwnerType::resolveName方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmOwnerType::resolveName方法的具体用法?PHP CCrmOwnerType::resolveName怎么用?PHP CCrmOwnerType::resolveName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmOwnerType
的用法示例。
在下文中一共展示了CCrmOwnerType::resolveName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: canRead
public function canRead($userId)
{
if ($this->canRead !== null) {
return $this->canRead;
}
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
if (\CSocNetUser::isCurrentUserModuleAdmin()) {
$this->canRead = true;
return $this->canRead;
}
if ($comment = $this->loadLogCommentData()) {
if (strpos($comment["EVENT_ID"], "crm_") === 0) {
$queryLog = \CSocNetLog::getList(array(), array("ID" => intval($comment["LOG_ID"])), false, false, array("ID", "ENTITY_TYPE", "ENTITY_ID"));
if (($log = $queryLog->fetch()) && Loader::includeModule("crm")) {
$userPermissions = \CCrmPerms::getUserPermissions($userId);
if ($log["ENTITY_TYPE"] == "CRMACTIVITY") {
$bindings = \CCRMActivity::getBindings($log["ENTITY_ID"]);
foreach ($bindings as $binding) {
if (\CCrmAuthorizationHelper::checkReadPermission(\CCrmOwnerType::resolveName($binding["OWNER_TYPE_ID"]), $binding["OWNER_ID"], $userPermissions)) {
$this->canRead = true;
return $this->canRead;
}
}
} else {
if (\CCrmAuthorizationHelper::checkReadPermission(\CCrmLiveFeedEntity::resolveEntityTypeID($log["ENTITY_TYPE"]), $log["ENTITY_ID"], $userPermissions)) {
$this->canRead = true;
return $this->canRead;
} elseif (intval($comment["LOG_ID"]) > 0 && \CSocNetLogRights::checkForUser($comment["LOG_ID"], $userId)) {
$this->canRead = true;
return $this->canRead;
}
}
}
} elseif (intval($comment["LOG_ID"]) > 0 && \CSocNetLogRights::checkForUser($comment["LOG_ID"], $userId)) {
$this->canRead = true;
return $this->canRead;
}
}
$this->canRead = false;
return $this->canRead;
}