1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
componenthelper.php
См. документацию.
1<?php
9
12
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}
Определения loader.php:13
static getForumPermission(array $params=[])
Определения componenthelper.php:17
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
global $USER
Определения csv_new_run.php:40
$entityId
Определения payment.php:4
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
const SONET_ENTITY_GROUP
Определения include.php:117
const SONET_ENTITY_USER
Определения include.php:118