No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

42 líneas
1.3KB

  1. <?php
  2. namespace backend\controllers;
  3. use backend\controllers\BackendController;
  4. use domain\Feature\Feature\Feature;
  5. use yii\filters\AccessControl;
  6. class SponsorshipController extends BackendController
  7. {
  8. public function behaviors()
  9. {
  10. return [
  11. 'access' => [
  12. 'class' => AccessControl::class,
  13. 'rules' => [
  14. [
  15. 'allow' => true,
  16. 'roles' => ['@'],
  17. 'matchCallback' => function ($rule, $action) {
  18. return
  19. $this->getFeatureModule()->getChecker()->isEnabled(Feature::ALIAS_SPONSORSHIP)
  20. && $this->getUserModule()
  21. ->getAuthorizationChecker()
  22. ->isGrantedAsProducer($this->getUserCurrent());
  23. }
  24. ],
  25. ],
  26. ],
  27. ];
  28. }
  29. public function actionIndex()
  30. {
  31. $producerCurrent = $this->getProducerCurrent();
  32. return $this->render('index', [
  33. 'producer' => $producerCurrent,
  34. 'producersGodsonsArray' => $this->getProducerModule()->getRepository()->findProducersSponsorshipGodsons($producerCurrent)
  35. ]);
  36. }
  37. }