Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
diskfolderaccesscheck.php
1
<?php
2
3
namespace
Bitrix\Im\Controller\Call\Filter
;
4
5
use
Bitrix\Main\Error
;
6
use
Bitrix\Main\Event
;
7
use
Bitrix\Main\Engine\ActionFilter\Base
;
8
use
Bitrix\Main\EventResult
;
9
16
class
DiskFolderAccessCheck
extends
Base
17
{
18
public
function
onBeforeAction
(
Event
$event)
19
{
20
$chatId = $this->action->getController()->getRequest()->getHeader(
'Call-Chat-Id'
);
21
if
(!$chatId)
22
{
23
$this->
addError
(
new
Error
(
"Header Call-Chat-Id can't be empty"
));
24
25
return
new
EventResult
(EventResult::ERROR,
null
,
null
, $this);
26
}
27
28
if
(!\
Bitrix
\Im\
Chat::hasAccess
($chatId))
29
{
30
$this->
addError
(
new
Error
(
"You don't have access to this chat"
));
31
32
return
new
EventResult
(EventResult::ERROR,
null
,
null
, $this);
33
}
34
35
return
null
;
36
}
37
}
Bitrix\Im\Controller\Call\Filter\DiskFolderAccessCheck
Definition
diskfolderaccesscheck.php:17
Bitrix\Im\Controller\Call\Filter\DiskFolderAccessCheck\onBeforeAction
onBeforeAction(Event $event)
Definition
diskfolderaccesscheck.php:18
Bitrix\Im\V2\Chat\hasAccess
hasAccess($user=null)
Definition
Chat.php:499
Bitrix\Main\Engine\ActionFilter\Base
Definition
base.php:15
Bitrix\Main\Engine\ActionFilter\Base\addError
addError(Error $error)
Definition
base.php:80
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\Event
Definition
event.php:5
Bitrix\Main\EventResult
Definition
eventresult.php:5
Bitrix\Im\Controller\Call\Filter
Definition
authorization.php:3
Bitrix
modules
im
lib
controller
call
filter
diskfolderaccesscheck.php
Создано системой
1.10.0