public function beforeAction($action) { $operacion = str_replace("/", "-", Yii::$app->controller->route); if (!AccessHelpers::getAcceso($operacion)) { echo $this->render('../site/nopermitido'); return false; } return true; }
public function beforeAction($action) { if (!parent::beforeAction($action)) { return false; } $operacion = str_replace("/", "-", Yii::$app->controller->route); $permitirSiempre = ['site-captcha', 'site-signup', 'site-index', 'site-error', 'site-contact', 'site-login', 'site-logout', 'site-reset-password', 'site-request-password-reset']; if (in_array($operacion, $permitirSiempre)) { return true; } if (!AccessHelpers::getAcceso($operacion)) { echo $this->render('nopermitido'); return false; } return true; }