public function users(string $authorId = '')
{
$authorId = (int) $authorId;
if ($this->isSuperUser()) {
$inCharge = true;
} else {
$authorsForUser = $this->author->getAuthorIdsForUser($this->getActiveUserId());
// Check
if (!\in_array($authorId, $authorsForUser)) {
\Airship\redirect($this->airship_cabin_prefix . '/author');
}
$inCharge = $this->author->userIsOwner($authorId);
}
// Only someone in charge can add/remove users:
if ($inCharge) {
$post = $this->post(new UsersFilter());
if ($post) {
if ($this->manageAuthorUsers($authorId, $post)) {
\Airship\redirect($this->airship_cabin_prefix . '/author/users/' . $authorId);
}
}
}
$this->lens('author/users', ['author' => $this->author->getById($authorId), 'inCharge' => $inCharge, 'users' => $this->author->getUsersForAuthor($authorId)]);
}