This commit is contained in:
resurtm
2016-12-21 13:21:40 +06:00
parent 462e99788f
commit 2686a54aa3
4 changed files with 10 additions and 5 deletions

View File

@ -40,6 +40,7 @@ before_script:
# initialize database # initialize database
- mysql -e 'CREATE DATABASE `yii2-usuario-test`;'; - mysql -e 'CREATE DATABASE `yii2-usuario-test`;';
- php tests/_app/yii.php migrate/up --interactive=0 - php tests/_app/yii.php migrate/up --interactive=0
- php tests/_app/yii.php migrate/up --interactive=0 --migrationPath=@yii/rbac/migrations
# enable code coverage on PHP 7.1, only one PHP version needs to generate coverage data # enable code coverage on PHP 7.1, only one PHP version needs to generate coverage data
- | - |

View File

@ -50,6 +50,7 @@ class Bootstrap implements BootstrapInterface
} else { } else {
/* @var $app ConsoleApplication */ /* @var $app ConsoleApplication */
$this->initConsoleCommands($app); $this->initConsoleCommands($app);
$this->initAuthManager($app);
} }
} }
} }

View File

@ -61,7 +61,7 @@ class AdminController extends Controller
*/ */
public function beforeAction($action) public function beforeAction($action)
{ {
if (in_array($action->id, ['index', 'update', 'update-profile', 'info', 'assignments'])) { if (in_array($action->id, ['index', 'update', 'update-profile', 'info', 'assignments'], true)) {
Url::remember('', 'actions-redirect'); Url::remember('', 'actions-redirect');
} }
@ -75,7 +75,7 @@ class AdminController extends Controller
{ {
return [ return [
'verbs' => [ 'verbs' => [
'class' => VerbFilter::className(), 'class' => VerbFilter::class,
'actions' => [ 'actions' => [
'delete' => ['post'], 'delete' => ['post'],
'confirm' => ['post'], 'confirm' => ['post'],
@ -83,9 +83,9 @@ class AdminController extends Controller
], ],
], ],
'access' => [ 'access' => [
'class' => AccessControl::className(), 'class' => AccessControl::class,
'ruleConfig' => [ 'ruleConfig' => [
'class' => AccessRuleFilter::className(), 'class' => AccessRuleFilter::class,
], ],
'rules' => [ 'rules' => [
[ [

View File

@ -11,10 +11,13 @@ return [
'log' => null, 'log' => null,
'cache' => null, 'cache' => null,
'db' => require __DIR__.'/db.php', 'db' => require __DIR__.'/db.php',
'authManager' => [
'class' => Da\User\Component\AuthDbManagerComponent::class,
],
], ],
'controllerMap' => [ 'controllerMap' => [
'migrate' => [ 'migrate' => [
'class' => \yii\console\controllers\MigrateController::class, 'class' => yii\console\controllers\MigrateController::class,
'migrationPath' => null, 'migrationPath' => null,
'migrationNamespaces' => [ 'migrationNamespaces' => [
'Da\User\Migration', 'Da\User\Migration',