From 8ebd8f3251394f3aeb1d0ec94fe4fcafce142462 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Thu, 24 Nov 2022 16:46:42 +0100 Subject: [PATCH] - add doc-type:ResearchData inside oai.controller.ts for DINI validation - check if files are accessible with read rights for api file download (inside fule.controller.ts) --- src/controllers/file.controller.ts | 2 +- src/controllers/oai.controller.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/file.controller.ts b/src/controllers/file.controller.ts index f7210c6..25113c8 100644 --- a/src/controllers/file.controller.ts +++ b/src/controllers/file.controller.ts @@ -20,7 +20,7 @@ export class FileController { const ext = path.extname(filePath); const fileName = file.label + ext; try { - fs.accessSync(filePath, fs.constants.R_OK | fs.constants.W_OK); + fs.accessSync(filePath, fs.constants.R_OK); //| fs.constants.W_OK); // console.log("can read/write:", path); res.set({ "Cache-Control": "no-cache private", diff --git a/src/controllers/oai.controller.ts b/src/controllers/oai.controller.ts index 6d90ef5..76e936e 100644 --- a/src/controllers/oai.controller.ts +++ b/src/controllers/oai.controller.ts @@ -228,6 +228,7 @@ export class OaiController { const sets: { [key: string]: string } = { open_access: "Set for open access licenses", + "doc-type:ResearchData": "Set for document type ResearchData", // 'bibliography:true' => 'Set for bibliographic entries', // 'bibliography:false' => 'Set for non-bibliographic entries', ...(await this.getSetsForDatasetTypes()),