diff --git a/lib/Db/ContextMapper.php b/lib/Db/ContextMapper.php index 080fba769..a957c7238 100644 --- a/lib/Db/ContextMapper.php +++ b/lib/Db/ContextMapper.php @@ -170,6 +170,7 @@ public function findAll(?string $userId = null): array { } public function findForNavBar(string $userId): array { $qb = $this->getFindContextBaseQuery($userId); + $groupIDs = $this->userHelper->getGroupIdsForUser($userId); $qb->andWhere($qb->expr()->orX( // default $qb->expr()->andX( @@ -183,6 +184,11 @@ public function findForNavBar(string $userId): array { $qb->expr()->neq('c.owner_id', $qb->createNamedParameter($userId)), $qb->expr()->gt('n.display_mode', $qb->createNamedParameter(Application::NAV_ENTRY_MODE_HIDDEN, IQueryBuilder::PARAM_INT)), ), + $qb->expr()->andX( + $qb->expr()->eq('s.receiver_type', $qb->createNamedParameter('group')), + $qb->expr()->in('s.receiver', $qb->createNamedParameter($groupIDs, IQueryBuilder::PARAM_STR_ARRAY)), + $qb->expr()->gt('n.display_mode', $qb->createNamedParameter(Application::NAV_ENTRY_MODE_HIDDEN, IQueryBuilder::PARAM_INT)), + ) ), ), // user override