forked from Yara724/api
YARA-1259
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user