You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. in the authorization controller, I can log in. but when i go to another page my user is not authorized Yii::$app->user->identity === null => true
`<?php
$params = require DIR . '/params.php';
$db = require DIR . '/db.php';
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
}
return $config;`
The text was updated successfully, but these errors were encountered:
Hello. in the authorization controller, I can log in. but when i go to another page my user is not authorized
Yii::$app->user->identity === null => true
`<?php
$params = require DIR . '/params.php';
$db = require DIR . '/db.php';
$config = [
'id' => 'basic',
'basePath' => dirname(DIR),
'bootstrap' => ['log'],
'language' => 'ru',
'modules' => [
'rbac' => [
'class' => 'mdm\admin\Module',
'layout' => '@app/views/layouts/rbac.php',
'controllerMap' => [
'assignment' => [
'class' => 'app\controllers\rbac\AssignmentController',
'idField' => 'id',
'usernameField' => 'username'
],
'route' => ['class' => 'app\controllers\rbac\RouteController'],
'permission' => ['class' => 'app\controllers\rbac\PermissionController'],
'role' => ['class' => 'app\controllers\rbac\RoleController'],
'user' => ['class' => 'app\controllers\rbac\UserController']
]
],
'admin' => [
'class' => 'app\modules\admin\Module',
'layout' => 'admin.php'
]
],
'container' => [
'definitions' => [
\yii\widgets\LinkPager::class => \yii\bootstrap4\LinkPager::class,
]
],
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'as access' => [
'class' => 'mdm\admin\components\AccessControl',
'allowActions' => [
'site/*',
]
],
'components' => [
'authManager' => [
'class' => 'yii\rbac\DbManager'
],
'i18n' => [
'translations' => [
'rbac-admin' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@mdm/admin/messages',
'sourceLanguage' => 'ru'
]
]
],
'formatter' => [
'class' => 'yii\i18n\Formatter',
'locale' => 'ru-RU',
'defaultTimeZone' => 'Europe/Moscow',
'timeZone' => 'GMT+3',
'dateFormat' => 'd MMMM Y',
'datetimeFormat' => 'HH:i:s d/M/Y',
'timeFormat' => 'HH:i:s',
],
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => '_CQG_7Mqoxt5uxULlmM4xW-JlJQcW-pB',
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
'user' => [
'identityClass' => 'mdm\admin\models\User',
'loginUrl' => ['rbac/user/login'],
'enableSession' => true,
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => false,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.yandex.ru',
'port' => '465',
'encryption' => 'ssl',
]
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'db' => $db,
];
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
// 'admin/',
// 'gii/',
// 'direction/*'
];
}
return $config;`
The text was updated successfully, but these errors were encountered: