Commit 1f2fdc617833bcaddcbee5df99909eaa46290dea

Authored by Alexey Boroda
1 parent 7ba2947a

-Product carousel fix

Showing 1 changed file with 7 additions and 2 deletions   Show diff stats
controllers/OrderController.php
... ... @@ -4,6 +4,7 @@
4 4  
5 5 use artweb\artbox\components\SmsSender;
6 6 use artweb\artbox\ecommerce\models\OrderSearch;
  7 + use common\models\User;
7 8 use phpDocumentor\Reflection\Types\Null_;
8 9 use Yii;
9 10 use yii\helpers\ArrayHelper;
... ... @@ -289,9 +290,13 @@
289 290 }
290 291  
291 292 $model = $this->findModel($id);
292   -
  293 +
  294 + /**
  295 + * @var User $user
  296 + */
  297 + $user = \Yii::$app->user->identity;
293 298 if ($model->isBlocked() && $model->edit_id !== \Yii::$app->user->id) {
294   - if (!\Yii::$app->user->identity->isAdmin()) {
  299 + if (!$user->isAdmin()) {
295 300 throw new ForbiddenHttpException();
296 301 }
297 302 }
... ...