Airship\Cabin\Bridge\Landing\Author::users PHP Method

users() public method

Manage the users that have access to this author
public users ( string $authorId = '' )
$authorId string
    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)]);
    }