protected function createComponentFormAdd() { if ($this->user->isInRole('administrator')) { $form = $this->formFactory->create($this->model, $this->userModel->activeUsersAsArray()); } else { $form = $this->formFactory->create($this->model, $this->userModel->listedUsersAsArray(array($this->user->id))); } $form->onSuccess[] = array($this, 'addFormSucceeded'); return $form; }