YARA-1259

This commit is contained in:
SepehrYahyaee
2026-09-01 14:13:52 +03:30
parent a33466025d
commit 6880de5960
5 changed files with 234 additions and 13 deletions

View File

@@ -2558,11 +2558,21 @@ export class ExpertClaimService {
if (!blame) {
throw new NotFoundException("Linked blame file not found.");
}
if (!(blame as any).isMadeByFileMaker) {
const clientKey = requireActorClientKey(actor);
if (!blameCaseTouchesClient(blame, clientKey)) {
throw new ForbiddenException(
"This file does not belong to your organization.",
);
}
if (
!(blame as any).isMadeByFileMaker ||
!(blame as any).expertInitiated ||
(blame as any).creationMethod !== "IN_PERSON"
) {
throw new BadRequestException({
success: false,
status: "unavailable" satisfies ExpertFileAssignStatus,
message: "Only V4 FileMaker files can be assigned to a FileReviewer.",
message: "Only V4/V5 FileMaker files can be assigned to a FileReviewer.",
});
}
if ((blame as any).status !== "WAITING_FOR_FILE_REVIEWER") {
@@ -2674,6 +2684,12 @@ export class ExpertClaimService {
if (!reviewerBlame) {
throw new NotFoundException("Linked blame file not found.");
}
const clientKey = requireActorClientKey(actor);
if (!blameCaseTouchesClient(reviewerBlame, clientKey)) {
throw new ForbiddenException(
"This file does not belong to your organization.",
);
}
const assignedReviewerId = (reviewerBlame as any).assignedFileReviewerId
? String((reviewerBlame as any).assignedFileReviewerId)
: null;
@@ -4773,6 +4789,12 @@ export class ExpertClaimService {
"FileReviewers can only access V4/V5 FileMaker files.",
);
}
const clientKey = requireActorClientKey(actor);
if (!blameCaseTouchesClient(linkedBlame, clientKey)) {
throw new ForbiddenException(
"This file does not belong to your organization.",
);
}
const assignedReviewerId = (linkedBlame as any)?.assignedFileReviewerId
? String((linkedBlame as any).assignedFileReviewerId)
: null;