Commit 69382b37 authored by Arnaud Pauget's avatar Arnaud Pauget
Browse files

feat(18079) : check if the new originaator is in list of authorized originator

parent a4e0e996
Pipeline #14423 failed with stages
in 1 minute
......@@ -1056,9 +1056,12 @@ trait archiveModificationTrait
if ($currentOwnerOrgId != $newOriginatorOrg->ownerOrgId) {
$result["error"][] = $archiveId;
continue;
// throw new \bundle\recordsManagement\Exception\organizationException(
// "The new originator organization of the archive must have the same owner organization as the current one."
// );
}
$isAvailableOriginator = array_search($archive->originatorOrgRegNumber, array_column($this->getDescendantServices($archive->originatorOwnerOrgId, $archive->archivalAgreementReference), 'orgId'));
if (!$isAvailableOriginator) {
$result["error"][] = $archiveId;
}
$archive->originatorOrgRegNumber = $newOriginatorOrg->registrationNumber;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment