26 $this->checkLevel = $checkLevel;
27 parent::__construct();
40 $user = $this->action->getCurrentUser();
44 if (!($user instanceof Main\Engine\
CurrentUser) || !$user->getId())
47 $accessMessage =
Loc::getMessage(
'TRANSLATE_FILTER_ERROR_ACCESS_DENIED');
52 switch ($this->checkLevel)
54 case Translate\Permission::SOURCE:
58 $accessMessage =
Loc::getMessage(
'TRANSLATE_FILTER_ERROR_WRITING_RIGHTS');
62 case Translate\Permission::WRITE:
66 $accessMessage =
Loc::getMessage(
'TRANSLATE_FILTER_ERROR_WRITING_RIGHTS');
70 case Translate\Permission::READ:
74 $accessMessage =
Loc::getMessage(
'TRANSLATE_FILTER_ERROR_ACCESS_DENIED');
83 $this->errorCollection[] =
new Main\Error($accessMessage, self::ERROR_ACCESS_DENIED);
85 return new Main\EventResult(Main\EventResult::ERROR,
null,
null, $this);
onBeforeAction(Event $event)
static getMessage($code, $replace=null, $language=null)