@@ -433,14 +433,14 @@ export class DataStoreService {
433
433
*
434
434
* @param survey the survey instance.
435
435
* @param userEmail the email of the user to filter the results.
436
- * @param canManageSurvey a flag indicating whether the user has survey organizer or owner level permissions of the survey.
436
+ * @param canViewAll a flag indicating whether the user has permission to view all LOIs for this survey.
437
437
*/
438
438
getAccessibleLois$ (
439
439
{ id : surveyId } : Survey ,
440
440
userId : string ,
441
- canManageSurvey : boolean
441
+ canViewAll : boolean
442
442
) : Observable < List < LocationOfInterest > > {
443
- if ( canManageSurvey ) {
443
+ if ( canViewAll ) {
444
444
return this . db
445
445
. collection ( `${ SURVEYS_COLLECTION_NAME } /${ surveyId } /lois` )
446
446
. valueChanges ( { idField : 'id' } )
@@ -477,17 +477,17 @@ export class DataStoreService {
477
477
* @param survey the survey instance.
478
478
* @param loi the loi instance.
479
479
* @param userEmail the email of the user to filter the results.
480
- * @param canManageSurvey a flag indicating whether the user has survey organizer or owner level permissions of the survey.
480
+ * @param canViewAll a flag indicating whether the user has permission to view all LOIs for this survey.
481
481
*/
482
482
getAccessibleSubmissions$ (
483
483
survey : Survey ,
484
484
loi : LocationOfInterest ,
485
485
userId : string ,
486
- canManageSurvey : boolean
486
+ canViewAll : boolean
487
487
) : Observable < List < Submission > > {
488
488
return this . db
489
489
. collection ( `${ SURVEYS_COLLECTION_NAME } /${ survey . id } /submissions` , ref =>
490
- this . canViewSubmissions ( ref , loi . id , userId , canManageSurvey )
490
+ this . canViewSubmissions ( ref , loi . id , userId , canViewAll )
491
491
)
492
492
. valueChanges ( { idField : 'id' } )
493
493
. pipe (
@@ -621,10 +621,10 @@ export class DataStoreService {
621
621
ref : CollectionReference ,
622
622
loiId : string ,
623
623
userId : string ,
624
- canManageSurvey : boolean
624
+ canViewAll : boolean
625
625
) {
626
626
const query = ref . where ( sb . loiId , '==' , loiId ) ;
627
627
628
- return canManageSurvey ? query : query . where ( sb . ownerId , '==' , userId ) ;
628
+ return canViewAll ? query : query . where ( sb . ownerId , '==' , userId ) ;
629
629
}
630
630
}
0 commit comments