public function bootstrap($app)
{
// register translations
if (!isset($app->get('i18n')->translations['rbac*'])) {
$app->get('i18n')->translations['rbac*'] = ['class' => 'yii\\i18n\\PhpMessageSource', 'basePath' => __DIR__ . '/messages'];
}
if ($this->checkRbacModuleInstalled($app)) {
$authManager = $app->get('authManager', false);
if (!$authManager) {
$app->set('authManager', ['class' => DbManager::className()]);
} else {
if (!$authManager instanceof ManagerInterface) {
throw new InvalidConfigException('You have wrong authManager configuration');
}
}
// if dektrium/user extension is installed, copy admin list from there
if ($this->checkUserModuleInstalled($app) && $app instanceof WebApplication) {
$app->getModule('rbac')->admins = $app->getModule('user')->admins;
}
}
}