forked from Yara724/api
Merge pull request 'Fixed file maker view files error' (#189) from s.yahyaee/yara724-api:main into main
Reviewed-on: Yara724/api#189
This commit is contained in:
@@ -4692,8 +4692,8 @@ export class ExpertClaimService {
|
|||||||
const isFactorValidationPending =
|
const isFactorValidationPending =
|
||||||
claimIsAwaitingExpertFactorValidationV2(claim);
|
claimIsAwaitingExpertFactorValidationV2(claim);
|
||||||
|
|
||||||
// FileMaker: can only view V5 files (requiresFileMakerApproval: true) that they created.
|
// FileMaker: can view any file they created (both during filing and approval phase).
|
||||||
// V4 files do not require FileMaker approval and must not appear in their panel.
|
// The list endpoint already filters to V5-only; detail access is scoped by ownership.
|
||||||
if (actor.role === RoleEnum.FILE_MAKER) {
|
if (actor.role === RoleEnum.FILE_MAKER) {
|
||||||
const isOwn = claimCaseInitiatedByFieldExpert(claim, actor, linkedBlame);
|
const isOwn = claimCaseInitiatedByFieldExpert(claim, actor, linkedBlame);
|
||||||
if (!isOwn) {
|
if (!isOwn) {
|
||||||
@@ -4701,11 +4701,6 @@ export class ExpertClaimService {
|
|||||||
"FileMakers can only view files they created.",
|
"FileMakers can only view files they created.",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!(claim as any).requiresFileMakerApproval) {
|
|
||||||
throw new ForbiddenException(
|
|
||||||
"This file does not require FileMaker approval.",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// Fall through to the detail build below
|
// Fall through to the detail build below
|
||||||
} else if (
|
} else if (
|
||||||
// Field experts and FileReviewers can view IN_PERSON expert-initiated claims
|
// Field experts and FileReviewers can view IN_PERSON expert-initiated claims
|
||||||
|
|||||||
Reference in New Issue
Block a user