Commit 16aaf6ac31bba8eb31ef1c78b1e622a7278bf1e5
1 parent
4ce65850
-Order blocking small update
Showing
1 changed file
with
5 additions
and
2 deletions
Show diff stats
controllers/OrderController.php
... | ... | @@ -405,9 +405,12 @@ |
405 | 405 | * @var User $user |
406 | 406 | */ |
407 | 407 | $user = \Yii::$app->user->identity; |
408 | - if ($model->isBlocked() && $model->edit_id !== \Yii::$app->user->id) { | |
408 | + if ($model->isBlocked() && $model->edit_id !== $user->id) { | |
409 | + $editUser = User::findOne($model->edit_id); | |
409 | 410 | if (!$user->isAdmin()) { |
410 | - throw new ForbiddenHttpException(); | |
411 | + if (!empty($editUser)) { | |
412 | + throw new ForbiddenHttpException("Заказ закреплен за пользователем: " . $editUser->username); | |
413 | + } | |
411 | 414 | } |
412 | 415 | } |
413 | 416 | if (!empty($user->permissions)) { | ... | ... |