[ 'class' => AccessControl::class, 'rules' => [ [ 'allow' => true, 'roles' => ['@'], 'matchCallback' => function ($rule, $action) { return $this->getUserModule() ->getAuthorizationChecker() ->isGrantedAsProducer($this->getUserCurrent()); } ], ], ], ]; } /** * Affiche le tableau de bord avec les distributions à venir et les dernières commandes passées ou modifiées. */ public function actionIndex() { return $this->render('index', [ 'producer' => $this->getProducerCurrent(), 'productsCount' => $this->getProductModule()->getRepository()->countProducts(), 'pointsSaleCount' => $this->getPointSaleModule()->getRepository()->countPointSales(), 'distributionsArray' => $this->getDistributionModule()->getRepository()->findDistributionsDashboard(), 'ordersArray' => $this->getOrderModule()->getRepository()->findOrdersDashboard(), 'subscriptionsLatestAddedArray' => $this->getSubscriptionModule()->getRepository()->findSubscriptionsLatestAdded() ]); } }