fix: Cannot import into parent document, regression from new permissions logic. closes #6471

This commit is contained in:
Tom Moor
2024-02-01 18:26:30 -05:00
parent a963a63ee1
commit 6f1d02dfad

View File

@@ -1334,16 +1334,11 @@ router.post(
let parentDocument;
if (parentDocumentId) {
parentDocument = await Document.findOne({
where: {
id: parentDocumentId,
collectionId: collection.id,
},
parentDocument = await Document.findByPk(parentDocumentId, {
userId: user.id,
transaction,
});
authorize(user, "read", parentDocument, {
collection,
});
authorize(user, "read", parentDocument);
}
const content = await fs.readFile(file.filepath);