|
|
@@ -2,16 +2,19 @@ |
|
|
|
|
|
|
|
use common\helpers\GlobalParam; |
|
|
|
use common\logic\Producer\Producer\Model\Producer; |
|
|
|
use common\logic\Producer\Producer\Module\ProducerModule; |
|
|
|
use common\logic\User\User\Module\UserModule; |
|
|
|
use yii\bootstrap\Nav; |
|
|
|
use yii\helpers\Html; |
|
|
|
|
|
|
|
$userModule = UserModule::getInstance(); |
|
|
|
$producerModule = ProducerModule::getInstance(); |
|
|
|
$userCurrent = GlobalParam::getCurrentUser(); |
|
|
|
|
|
|
|
$isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGrantedAsProducer($userCurrent); |
|
|
|
$producer = null; |
|
|
|
if ($isUserCurrentGrantedAsProducer) { |
|
|
|
$producer = Producer::searchOne(['id' => \Yii::$app->user->identity->id_producer]); |
|
|
|
$producer = $producerModule->getRepository()->findOneProducerById(\Yii::$app->user->identity->id_producer); |
|
|
|
} |
|
|
|
|
|
|
|
?> |