public function behaviors() { return ['access' => ['class' => AccessControl::className(), 'rules' => [['allow' => true, 'matchCallback' => function ($rule, $action) { $person = PersonRepository::getByUser(\Yii::$app->getUser()->identity); return $person && $person->user()->type()->type() == UserType::USER_PHOTOGRAPGER; }]]]]; }