Transfer changes from enterprise codebase

This commit is contained in:
Tom Moor
2023-05-13 12:30:24 -04:00
parent 7ce97f4d50
commit e2bc2f2067
7 changed files with 65 additions and 60 deletions

View File

@@ -92,7 +92,7 @@ allow(User, "share", Collection, (user, collection) => {
return true;
});
allow(User, "readDocument", Collection, (user, collection) => {
allow(User, ["readDocument", "export"], Collection, (user, collection) => {
if (!collection || user.teamId !== collection.teamId) {
return false;
}

View File

@@ -576,7 +576,7 @@ router.post(
const collection = await Collection.scope({
method: ["withMembership", user.id],
}).findByPk(id);
authorize(user, "read", collection);
authorize(user, "export", collection);
const fileOperation = await sequelize.transaction(async (transaction) =>
collectionExporter({