Fixes: Share links in private collections visible in share listing

This commit is contained in:
Tom Moor
2019-01-05 23:13:58 -08:00
parent 70287de6d7
commit 028160d9ad
2 changed files with 24 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ router.post('shares.list', auth(), pagination(), async ctx => {
if (user.isAdmin) delete where.userId;
const collectionIds = await user.collectionIds();
const shares = await Share.findAll({
where,
order: [[sort, direction]],
@@ -33,6 +34,9 @@ router.post('shares.list', auth(), pagination(), async ctx => {
model: Document,
required: true,
as: 'document',
where: {
collectionId: collectionIds,
},
},
{
model: User,