Airship\Cabin\Bridge\Landing\Ajax::getAuthorsAvailablePhotos PHP Method

getAuthorsAvailablePhotos() public method

    public function getAuthorsAvailablePhotos()
    {
        $auth_bp = $this->blueprint('Author');
        if (IDE_HACKS) {
            $db = \Airship\get_database();
            $auth_bp = new Author($db);
        }
        $authorId = (int) ($_POST['author'] ?? 0);
        if (!$this->isSuperUser()) {
            $authors = $auth_bp->getAuthorIdsForUser($this->getActiveUserId());
            if (!\in_array($authorId, $authors)) {
                \Airship\json_response(['status' => 'ERROR', 'message' => \__('You do not have permission to access this author\'s posts.')]);
            }
        }
        if (empty($_POST['cabin']) || !$authorId === 0) {
            \Airship\json_response(['status' => 'ERROR', 'message' => 'Insufficient parameters']);
        }
        \Airship\json_response(['status' => 'OK', 'message' => '', 'photos' => $auth_bp->getAvailablePhotos($authorId, $_POST['cabin'])]);
    }