Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
SettingsCheckAccess.php
1<?php
2
4
10
12{
13 public function onBeforeAction(Event $event)
14 {
15 $userId = (int)$this->getAction()->getArguments()['userId'];
16 $currentUserId = User::getCurrent()->getId();
17 if (
18 $userId !== $currentUserId
19 && !User::getCurrent()->isAdmin()
20 )
21 {
23
24 return new EventResult(EventResult::ERROR, null, null, $this);
25 }
26
27 return null;
28 }
29}