public function edit(string $authorId = '')
{
$authorId = (int) $authorId;
if (!$this->isSuperUser()) {
$authorsForUser = $this->author->getAuthorIdsForUser($this->getActiveUserId());
// Check
if (!\in_array($authorId, $authorsForUser)) {
\Airship\redirect($this->airship_cabin_prefix . '/author');
}
}
$post = $this->post(new AuthorFilter());
if (!empty($post['name'])) {
if ($this->author->updateAuthor($authorId, $post)) {
\Airship\redirect($this->airship_cabin_prefix . '/author');
}
}
$this->lens('author/edit', ['author' => $this->author->getById($authorId)]);
}