yii\filters\AccessControl::denyAccess PHP Метод

denyAccess() защищенный Метод

The default implementation will redirect the user to the login page if he is a guest; if the user is already logged, a 403 HTTP exception will be thrown.
protected denyAccess ( User $user )
$user yii\web\User the current user
    protected function denyAccess($user)
    {
        if ($user->getIsGuest()) {
            $user->loginRequired();
        } else {
            throw new ForbiddenHttpException(Yii::t('yii', 'You are not allowed to perform this action.'));
        }
    }