Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
element.php
1<?
2
4
5class Element
6{
7 public static function buildPreview($parameters)
8 {
9 global $APPLICATION;
10
11 ob_start();
12 $APPLICATION->IncludeComponent(
13 'bitrix:lists.element.preview',
14 '',
15 $parameters
16 );
17 return ob_get_clean();
18 }
19
20 public static function checkUserReadAccess($parameters)
21 {
22 global $USER;
23
24 $parameters['listId'] = (int)$parameters['listId'];
25 $parameters['elementId'] = (int)$parameters['elementId'];
26
27 if($parameters['listId'] == 0 || $parameters['elementId'] == 0)
28 return false;
29
30 $userPermission = \CListPermissions::CheckAccess(
31 $USER,
32 $parameters["IBLOCK_TYPE_ID"],
33 $parameters['listId']
34 );
35 if($userPermission < 0)
36 {
37 return false;
38 }
39 else if( $userPermission < \CListPermissions::CAN_READ
40 && !\CIBlockElementRights::UserHasRightTo($parameters['listId'], $parameters['elementId'], "element_read"))
41 {
42 return false;
43 }
44
45 return true;
46 }
47
48}
static checkUserReadAccess($parameters)
Definition element.php:20
static buildPreview($parameters)
Definition element.php:7