@tstdl/base 0.93.7 → 0.93.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -33,24 +33,26 @@ let DocumentManagementApiController = DocumentManagementApiController_1 = class
|
|
|
33
33
|
async loadData(context) {
|
|
34
34
|
const token = await context.getToken();
|
|
35
35
|
const tenantId = await this.#authorizationService.getTenantId(token);
|
|
36
|
-
|
|
36
|
+
const collectionIdArray = toArray(context.parameters.collectionIds);
|
|
37
|
+
for (const collectionId of collectionIdArray) {
|
|
37
38
|
const allowed = await this.#authorizationService.canReadCollection(collectionId, token);
|
|
38
39
|
if (!allowed) {
|
|
39
40
|
throw new ForbiddenError(`You are not allowed to read collection ${collectionId}`);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
return await this.#documentManagementService.loadData(tenantId,
|
|
43
|
+
return await this.#documentManagementService.loadData(tenantId, collectionIdArray);
|
|
43
44
|
}
|
|
44
45
|
async *loadDataStream(context) {
|
|
45
46
|
const token = await context.getToken();
|
|
46
47
|
const tenantId = await this.#authorizationService.getTenantId(token);
|
|
47
|
-
|
|
48
|
+
const collectionIdArray = toArray(context.parameters.collectionIds);
|
|
49
|
+
for (const collectionId of collectionIdArray) {
|
|
48
50
|
const allowed = await this.#authorizationService.canReadCollection(collectionId, token);
|
|
49
51
|
if (!allowed) {
|
|
50
52
|
throw new ForbiddenError(`You are not allowed to read collection ${collectionId}`);
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
|
-
yield* this.#documentManagementService.loadDataStream(tenantId,
|
|
55
|
+
yield* this.#documentManagementService.loadDataStream(tenantId, collectionIdArray, this.#cancellationSignal);
|
|
54
56
|
}
|
|
55
57
|
async loadDocumentRequestsTemplateData(context) {
|
|
56
58
|
const token = await context.getToken();
|