1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
componenthelper.php
См. документацию.
1
<?php
8
namespace
Bitrix\Socialnetwork\Helper\Forum
;
9
10
use
Bitrix\Forum\Permission
;
11
use
Bitrix\Main\Loader
;
12
13
class
ComponentHelper
14
{
15
private
static
$cachedResult = [];
16
17
public
static
function
getForumPermission
(
array
$params
= []): ?string
18
{
19
global
$USER
;
20
$currentUserId =
$USER
->getId();
21
$isCurrentUserAdmin = \CSocNetUser::isCurrentUserModuleAdmin();
22
$entityType = (
$params
[
'ENTITY_TYPE'
] ??
SONET_ENTITY_USER
);
23
$entityId
= (int)(
$params
[
'ENTITY_ID'
] ?? 0);
24
25
$result
=
null
;
26
27
if
(
28
!Loader::includeModule(
'forum'
)
29
|| !in_array($entityType, [
SONET_ENTITY_GROUP
,
SONET_ENTITY_USER
],
true
)
30
)
31
{
32
return
$result
;
33
}
34
35
$result
= Permission::ACCESS_DENIED;
36
37
if
(\CSocNetFeaturesPerms::canPerformOperation($currentUserId, $entityType,
$entityId
,
'forum'
,
'full'
, $isCurrentUserAdmin))
38
{
39
$result
= Permission::FULL_ACCESS;
40
}
41
elseif
(\CSocNetFeaturesPerms::CanPerformOperation($currentUserId, $entityType,
$entityId
,
'forum'
,
'newtopic'
, $isCurrentUserAdmin))
42
{
43
$result
= Permission::CAN_ADD_TOPIC;
44
}
45
elseif
(\CSocNetFeaturesPerms::CanPerformOperation($currentUserId, $entityType,
$entityId
,
'forum'
,
'answer'
, $isCurrentUserAdmin))
46
{
47
$result
= Permission::CAN_ADD_MESSAGE;
48
}
49
elseif
(\CSocNetFeaturesPerms::CanPerformOperation($currentUserId, $entityType,
$entityId
,
'forum'
,
'view'
, $isCurrentUserAdmin))
50
{
51
$result
= Permission::CAN_READ;
52
}
53
54
return
$result
;
55
}
56
}
Bitrix\Forum\Permission
Определения
permission.php:66
Bitrix\Main\Loader
Определения
loader.php:13
Bitrix\Socialnetwork\Helper\Forum\ComponentHelper
Определения
componenthelper.php:14
Bitrix\Socialnetwork\Helper\Forum\ComponentHelper\getForumPermission
static getForumPermission(array $params=[])
Определения
componenthelper.php:17
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
$USER
global $USER
Определения
csv_new_run.php:40
Bitrix\Socialnetwork\Helper\Forum
Определения
componenthelper.php:8
$entityId
$entityId
Определения
payment.php:4
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
SONET_ENTITY_GROUP
const SONET_ENTITY_GROUP
Определения
include.php:117
SONET_ENTITY_USER
const SONET_ENTITY_USER
Определения
include.php:118
bitrix
modules
socialnetwork
lib
helper
forum
componenthelper.php
Создано системой
1.14.0