diff --git a/lib/Db/ContextMapper.php b/lib/Db/ContextMapper.php index 4e17ce4d2..964e3d515 100644 --- a/lib/Db/ContextMapper.php +++ b/lib/Db/ContextMapper.php @@ -253,6 +253,10 @@ public function findAllContainingNode(int $nodeType, int $nodeId, string $userId protected function applyOwnedOrSharedQuery(IQueryBuilder $qb, string $userId): void { $sharedToConditions = $qb->expr()->orX(); + // shared by user clause + $userInitiatedShare = $qb->expr()->eq('s.sender', $qb->createNamedParameter($userId)); + $sharedToConditions->add($userInitiatedShare); + // shared to user clause $userShare = $qb->expr()->andX( $qb->expr()->eq('s.receiver_type', $qb->createNamedParameter('user')),