Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
CheckChatCanPost.php
1<?php
2
4
11
13{
14 public function onBeforeAction(Event $event)
15 {
16 $arguments = $this->getAction()->getArguments();
17 $arguments['rightsLevel'] = (new Converter(Converter::TO_UPPER))->process($arguments['rightsLevel'] ?? '');
18 $this->getAction()->setArguments($arguments);
19 if (in_array(
20 $arguments['rightsLevel'],
22 true
23 ))
24 {
25 return null;
26 }
27
28 $this->addError(new ChatError(
30 ));
31 return new EventResult(EventResult::ERROR, null, null, $this);
32 }
33}
const MANAGE_RIGHTS_MEMBER
Definition Chat.php:133
const MANAGE_RIGHTS_MANAGERS
Definition Chat.php:135
const MANAGE_RIGHTS_NONE
Definition Chat.php:132
const MANAGE_RIGHTS_OWNER
Definition Chat.php:134
onBeforeAction(Event $event)