public function addMemberAction(Request $request, $boardId)
{
$journal = $this->get('ojs.journal_service')->getSelectedJournal();
if (!$this->isGranted('EDIT', $journal, 'boards')) {
throw new AccessDeniedException("You not authorized for edit this journal's board!");
}
$em = $this->getDoctrine()->getManager();
$board = $em->getRepository('OjsJournalBundle:Board')->find($boardId);
$boardMember = new BoardMember();
$addMemberForm = $this->createAddMemberForm($boardMember, $board, $journal);
$addMemberForm->handleRequest($request);
if ($addMemberForm->isValid()) {
$boardMember->setBoard($board);
$em->persist($boardMember);
$em->flush();
$this->successFlashBag('successful.create');
}
return $this->redirectToRoute('ojs_journal_board_show', ['id' => $board->getId(), 'journalId' => $journal->getId()]);
}