Skip to content

Commit

Permalink
fix fetching documents by collectionID with importer token
Browse files Browse the repository at this point in the history
  • Loading branch information
olzraiti committed Dec 17, 2024
1 parent cc5a3ff commit 9a224b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/documents/documents.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class DocumentsService {
const viewableForAll = (await this.formsService.findListedByCollectionID(collectionID))
.some(f => f.options?.documentsViewableForAll);
if (
!permissions?.admins.includes(person.id)
!person.isImporter() && !permissions?.admins.includes(person.id)
&& (!viewableForAll || !permissions?.editors.includes(person.id))
) {
storeQuery = and(storeQuery, editorOrCreatorClause(person));
Expand Down Expand Up @@ -138,6 +138,7 @@ export class DocumentsService {
selectedFields?: (keyof Document)[]
) {
const [storeQuery, cacheConfig] = await this.getClauseForPublicQuery(query, person, observationYear);
console.log("!", storeQuery);
return await this.store.getPage(
storeQuery,
page,
Expand Down

0 comments on commit 9a224b3

Please sign in to comment.