<?php
/** @var \NightsWatch\Entity\Announcement[] $announcements */
/** @var \NightsWatch\Entity\User $identity */
/** @var \Zend\View\Model\ViewModel $this */
if ($identity && $identity->rank >= \NightsWatch\Entity\User::RANK_LIEUTENANT) {
    echo '<a class="btn btn-primary" style="float:right;" href="' . $this->url('home', ['controller' => 'announcement', 'action' => 'create']) . '">Post Announcement</a>';
}
if (!count($announcements)) {
    echo '<p class="alert alert-info">There are no announcements viewable by your rank.</p>';
} else {
    foreach ($announcements as $announcement) {
        echo $this->partial('nights-watch/announcement/partials/announcement', ['announcement' => $announcement]);
    }
}

<?php
/** @var \NightsWatch\Entity\Announcement[] $announcements */
/** @var \NightsWatch\Entity\User $identity */
/** @var \Zend\View\Model\ViewModel $this */
if ($identity && $identity->rank >= \NightsWatch\Entity\User::RANK_GENERAL) {
    echo '<a class="btn btn-primary" style="float:right;" href="' . $this->url('home', ['controller' => 'announcement', 'action' => 'create']) . '">Post Announcement</a>';
}
if (!count($announcements)) {
    echo '<p class="alert alert-info">There are no announcements viewable by your rank.</p>';
} else {
    foreach ($announcements as $announcement) {
        echo $this->partial('nights-watch/announcement/partials/announcement', ['announcement' => $announcement]);
    }
}

Fix Announcement Button for appropriate Rank
Fix Announcement Button for appropriate Rank
