diff --git a/library/Icingadb/Widget/ItemList/RedundancyGroupListItem.php b/library/Icingadb/Widget/ItemList/RedundancyGroupListItem.php index 88aa1108d..9780053e2 100644 --- a/library/Icingadb/Widget/ItemList/RedundancyGroupListItem.php +++ b/library/Icingadb/Widget/ItemList/RedundancyGroupListItem.php @@ -4,6 +4,7 @@ namespace Icinga\Module\Icingadb\Widget\ItemList; +use Icinga\Module\Icingadb\Common\Auth; use Icinga\Module\Icingadb\Common\Database; use Icinga\Module\Icingadb\Common\ListItemCommonLayout; use Icinga\Module\Icingadb\Model\RedundancyGroup; @@ -23,17 +24,16 @@ * Redundancy group list item. Represents one database row. * * @property RedundancyGroup $item + * @property RedundancyGroupState $state */ class RedundancyGroupListItem extends StateListItem { use ListItemCommonLayout; use Database; + use Auth; protected $defaultAttributes = ['class' => ['redundancy-group-list-item']]; - /** @var RedundancyGroupState */ - protected $state; - protected function init(): void { parent::init(); @@ -68,11 +68,12 @@ protected function assembleVisual(BaseHtmlElement $visual): void protected function assembleCaption(BaseHtmlElement $caption): void { - $caption->addHtml(new DependencyNodeStatistics( - RedundancyGroupSummary::on($this->getDb()) - ->filter(Filter::equal('id', $this->item->id)) - ->first() - )); + $summary = RedundancyGroupSummary::on($this->getDb()) + ->filter(Filter::equal('id', $this->item->id)); + + $this->applyRestrictions($summary); + + $caption->addHtml(new DependencyNodeStatistics($summary->first())); } protected function assembleTitle(BaseHtmlElement $title): void