Skip to content

Commit 84e26e5

Browse files
blizzzenjeck
authored andcommitted
feat(Contexts): consider group shares when determining nav display
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent 265c77e commit 84e26e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Db/ContextMapper.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ public function findAll(?string $userId = null): array {
170170
}
171171
public function findForNavBar(string $userId): array {
172172
$qb = $this->getFindContextBaseQuery($userId);
173+
$groupIDs = $this->userHelper->getGroupIdsForUser($userId);
173174
$qb->andWhere($qb->expr()->orX(
174175
// default
175176
$qb->expr()->andX(
@@ -183,6 +184,11 @@ public function findForNavBar(string $userId): array {
183184
$qb->expr()->neq('c.owner_id', $qb->createNamedParameter($userId)),
184185
$qb->expr()->gt('n.display_mode', $qb->createNamedParameter(Application::NAV_ENTRY_MODE_HIDDEN, IQueryBuilder::PARAM_INT)),
185186
),
187+
$qb->expr()->andX(
188+
$qb->expr()->eq('s.receiver_type', $qb->createNamedParameter('group')),
189+
$qb->expr()->in('s.receiver', $qb->createNamedParameter($groupIDs, IQueryBuilder::PARAM_STR_ARRAY)),
190+
$qb->expr()->gt('n.display_mode', $qb->createNamedParameter(Application::NAV_ENTRY_MODE_HIDDEN, IQueryBuilder::PARAM_INT)),
191+
)
186192
),
187193
),
188194
// user override

0 commit comments

Comments
 (0)