Skip to content

Commit

Permalink
Use correct field to check view submissions permissions (#1965)
Browse files Browse the repository at this point in the history
  • Loading branch information
gino-m authored Aug 12, 2024
1 parent d080c09 commit e0cc72b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web/src/app/services/data-store/data-store.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,9 @@ export class DataStoreService {
}

/**
* Creates a new Query object to filter submissions based on two
* criteria: loi and user
* Creates a new Query object to filter submissions based on
* LOI and user IDs. User ID is ignored if user can manage this
* survey (i.e., they can view all submissions by default).
*/
private canViewSubmissions(
ref: CollectionReference,
Expand All @@ -606,7 +607,7 @@ export class DataStoreService {
canManageSurvey: boolean
) {
return canManageSurvey
? ref.where(s.loiId, '==', loiId)
? ref.where(sb.loiId, '==', loiId)
: ref.where(sb.loiId, '==', loiId).where(sb.ownerId, '==', userId);
}
}

0 comments on commit e0cc72b

Please sign in to comment.