Checking permissions in status- & discount import

This commit is contained in:
Frank Schubert
2024-06-04 18:41:42 +02:00
parent ce3e8f07e6
commit 2855a45208
4 changed files with 22 additions and 2 deletions
@@ -775,6 +775,7 @@ class PreorderController extends mfBaseController {
}
$i = 0;
$forbidden = 0;
$notfound = 0;
$invalidcode = 0;
$nochange = 0;
@@ -799,6 +800,11 @@ class PreorderController extends mfBaseController {
continue;
}
if($preorder->campaign->network->owner_id != $this->me->address_id) {
$forbidden++;
continue;
}
if($preorder->status->code != $new_status_code) {
$new_status = PreorderstatusModel::getFirst(["code" => $new_status_code]);
if(!$new_status_code) {
@@ -818,6 +824,9 @@ class PreorderController extends mfBaseController {
if($notfound) {
$message .= "<br />$notfound Bestellungen nicht gefunden";
}
if($forbidden) {
$message .= "<br />$forbidden Bestellungen in falschem Netzgebiet";
}
if($nochange) {
$message .= "<br />$nochange Bestelllungen haben bereits den neuen Status";
}