diff --git a/src/jobs/jobs.controller.ts b/src/jobs/jobs.controller.ts index 30cfee28c..30250bd9b 100644 --- a/src/jobs/jobs.controller.ts +++ b/src/jobs/jobs.controller.ts @@ -126,8 +126,8 @@ export class JobsController { } // check that datasetList is of type DatasetListDto[] - const datasetListDtos: DatasetListDto[] = datasetList.map(item => { - return Object.assign(new DatasetListDto(), (item)); + const datasetListDtos: DatasetListDto[] = datasetList.map((item) => { + return Object.assign(new DatasetListDto(), item); }); const allowedKeys = [JobParams.Pid, JobParams.Files] as string[]; for (const datasetListDto of datasetListDtos) { @@ -139,7 +139,8 @@ export class JobsController { throw new HttpException( { status: HttpStatus.BAD_REQUEST, - message: "Dataset list is expected to contain sets of pid and files.", + message: + "Dataset list is expected to contain sets of pid and files.", }, HttpStatus.BAD_REQUEST, ); @@ -267,9 +268,7 @@ export class JobsController { datasetList: DatasetListDto[], jobType: string, ): Promise { - const datasetsToCheck = datasetList.filter( - (x) => x.files.length > 0, - ); + const datasetsToCheck = datasetList.filter((x) => x.files.length > 0); const ids = datasetsToCheck.map((x) => x.pid); switch (jobType) { @@ -337,7 +336,7 @@ export class JobsController { checkResults.map(({ pid, nonExistFiles }) => ({ pid, nonExistFiles, - })) + })), ), }, HttpStatus.BAD_REQUEST, diff --git a/test/config/jobconfig.json b/test/config/jobconfig.json index 146043018..0c2be3670 100644 --- a/test/config/jobconfig.json +++ b/test/config/jobconfig.json @@ -1,73 +1,100 @@ { "configVersion": "v1.0 2024-03-01 6f3f38", "jobs": [ + { + "jobType": "all_access", + "create": { + "auth": "#all", + "actions": [ + { + "actionType": "log" + } + ] + }, + "statusUpdate": { + "auth": "#all" + } + }, { - "jobType": "all_access", - "create": { - "auth": "#all", - "actions": [ - { - "actionType": "log" - } - ] + "jobType": "public_access", + "create": { + "auth": "#datasetPublic" + }, + "statusUpdate": { + "auth": "#all" + } }, - "statusUpdate": { - "auth": "#all" - } - }, - { - "jobType": "public_access", - "create": { - "auth": "#datasetPublic" + { + "jobType": "authenticated_access", + "create": { + "auth": "#authenticated" + }, + "statusUpdate": { + "auth": "#all" + } }, - "statusUpdate": { - "auth": "#all" - } - }, - { - "jobType": "authenticated_access", - "create": { - "auth": "#authenticated" + { + "jobType": "dataset_access", + "create": { + "auth": "#datasetAccess" + }, + "statusUpdate": { + "auth": "#jobOwnerGroup" + } }, - "statusUpdate": { - "auth": "#all" - } - }, - { - "jobType": "dataset_access", - "create": { - "auth": "#datasetAccess" + { + "jobType": "owner_access", + "create": { + "auth": "#datasetOwner" + }, + "statusUpdate": { + "auth": "#jobOwnerUser" + } }, - "statusUpdate": { - "auth": "#jobOwnerGroup" - } - }, - { - "jobType": "owner_access", - "create": { - "auth": "#datasetOwner" + { + "jobType": "user_access", + "create": { + "auth": "user5.1" + }, + "statusUpdate": { + "auth": "user5.1" + } }, - "statusUpdate": { - "auth": "#jobOwnerUser" - } - }, - { - "jobType": "user_access", - "create": { - "auth": "user5.1" + { + "jobType": "group_access", + "create": { + "auth": "@group5" + }, + "statusUpdate": { + "auth": "@group5" + } }, - "statusUpdate": { - "auth": "user5.1" - } - }, - { - "jobType": "group_access", - "create": { - "auth": "@group5" + { + "jobType": "archive", + "create": { + "auth": "#all" + }, + "statusUpdate": { + "auth": "#all" + } + }, + { + "jobType": "retrieve", + "create": { + "auth": "#all" + }, + "statusUpdate": { + "auth": "#all" + } }, - "statusUpdate": { - "auth": "@group5" + { + "jobType": "public", + "create": { + "auth": "#all" + }, + "statusUpdate": { + "auth": "#all" + } } - } ] } \ No newline at end of file