Наследование: extends yii\behaviors\AttributeBehavior
Пример #1
0
<?php

use developeruz\db_rbac\behaviors\AccessBehavior;
$params = array_merge(require __DIR__ . '/params.php', require __DIR__ . '/params-local.php');
return ['id' => 'app', 'name' => 'Abs Analitics', 'homeUrl' => '/', 'basePath' => dirname(dirname(__DIR__)), 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', 'language' => 'ru', 'defaultRoute' => 'main/default/index', 'bootstrap' => ['log'], 'as AccessBehavior' => ['class' => AccessBehavior::className(), 'rules' => ['main/default' => [['actions' => ['index', 'error'], 'allow' => true]], 'user/default' => [['actions' => ['login', 'logout'], 'allow' => true]]]], 'modules' => ['permit' => ['class' => 'developeruz\\db_rbac\\Yii2DbRbac', 'params' => ['userClass' => 'app\\modules\\user\\models\\User']], 'main' => ['class' => 'app\\modules\\main\\Module'], 'user' => ['class' => 'app\\modules\\user\\Module']], 'components' => require __DIR__ . '/components.php', 'params' => $params];
Пример #2
0
<?php

use developeruz\db_rbac\behaviors\AccessBehavior;
$params = array_merge(require __DIR__ . '/../../common/config/params.php', require __DIR__ . '/../../common/config/params-local.php', require __DIR__ . '/params.php', require __DIR__ . '/params-local.php');
return ['as AccessBehavior' => ['class' => AccessBehavior::className(), 'rules' => ['site' => [['actions' => ['login', 'error'], 'allow' => true], ['actions' => ['index', 'logout'], 'allow' => true, 'roles' => ['@']]], 'permit/access' => [['allow' => true, 'roles' => ['@']]], 'permit/user' => [['allow' => true, 'roles' => ['@']]], 'yii2images/images' => [['allow' => true]], 'debug/default' => [['allow' => true, 'roles' => ['@']]], 'sort' => [['allow' => true]]]], 'id' => 'app-backend', 'name' => 'СЛУЖУ РОССИИ!', 'basePath' => dirname(__DIR__), 'controllerNamespace' => 'backend\\controllers', 'bootstrap' => ['log'], 'modules' => ['yii2images' => ['class' => 'rico\\yii2images\\Module', 'imagesStorePath' => '@frontend/web/images/store', 'imagesCachePath' => '@frontend/web/images/cache', 'graphicsLibrary' => 'GD', 'placeHolderPath' => '@webroot/images/placeHolder.png'], 'permit' => ['class' => 'developeruz\\db_rbac\\Yii2DbRbac', 'params' => ['userClass' => 'common\\models\\User']]], 'components' => ['user' => ['identityClass' => 'common\\models\\User', 'enableAutoLogin' => true], 'log' => ['traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [['class' => 'yii\\log\\FileTarget', 'levels' => ['error', 'warning']]]], 'errorHandler' => ['errorAction' => 'site/error']], 'params' => $params];
Пример #3
0
<?php

use developeruz\db_rbac\behaviors\AccessBehavior;
$params = (require __DIR__ . '/params.php');
$config = ['id' => 'basic', 'basePath' => dirname(__DIR__), 'language' => 'ru_RU', 'timeZone' => 'Europe/Moscow', 'bootstrap' => ['log'], 'modules' => ['appointment' => ['class' => 'app\\modules\\appointment\\Module'], 'permit' => ['class' => 'developeruz\\db_rbac\\Yii2DbRbac', 'layout' => '//admin', 'params' => ['userClass' => 'app\\models\\User']]], 'components' => ['request' => ['cookieValidationKey' => 'pTun1glY2bdczsWVVDYVkd6ioq2yhYNu'], 'cache' => ['class' => 'yii\\caching\\FileCache'], 'user' => ['identityClass' => 'app\\models\\User', 'enableAutoLogin' => true], 'errorHandler' => ['errorAction' => 'site/error'], 'mailer' => ['class' => 'yii\\swiftmailer\\Mailer', 'useFileTransport' => true], 'log' => ['traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [['class' => 'yii\\log\\FileTarget', 'levels' => ['error', 'warning']]]], 'db' => require __DIR__ . '/db.php', 'urlManager' => ['enablePrettyUrl' => true, 'enableStrictParsing' => true, 'showScriptName' => false, 'rules' => ['' => 'site/index', '18XOtUuePdVQpjX0' => 'site/login', '<action:(admin|logout|error|captcha|contact|import)>' => 'site/<action>', 'elfinder' => 'elfinder/index', 'elfinder/<action:\\w+>' => 'elfinder/<action>', 'login' => 'appointment/ticket/login', 'entry' => 'appointment/ticket/entry', 'ticket/<token:[A-Za-z0-9-_]+>' => 'appointment/ticket/view', 'ajax/time/<id:\\d+>/<date:[\\d\\.]+>' => 'appointment/ajax/time', 'ajax/<action:\\w+>/<id:\\d+>' => 'appointment/ajax/<action>', 'ajax/<action:\\w+>' => 'appointment/ajax/<action>', 'admin/<controller:(collection|file|link|log|menu|news|page|block|user)>' => '<controller>/admin', 'admin/link/create/<menuId:\\d+>' => 'link/create', 'admin/<controller:(collection|file|log|menu|news|page|block|user)>/create' => '<controller>/create', 'admin/<controller:(collection|file|link|log|menu|news|page|block|user)>/<action:(view|update|delete)>/<id:\\d+>' => '<controller>/<action>', 'admin/block/<slug:[A-Za-z0-9-_]+>' => 'block/view', 'admin/physician/tickets/<id:\\d+>/<date:[\\d-]+>' => 'appointment/physician/tickets', 'admin/physician/tickets/<id:\\d+>' => 'appointment/physician/tickets', 'admin/<controller:(locality|patient|physician|reception|specialty|ticket)>' => 'appointment/<controller>/admin', 'admin/<controller:(locality|patient|physician|reception|specialty)>/create' => 'appointment/<controller>/create', 'admin/reception/update/<physicianId:\\d+>' => 'appointment/reception/update', 'admin/patient/import' => 'appointment/patient/import', 'admin/<controller:(locality|patient|physician|reception|specialty|ticket)>/<action:(view|update|delete)>/<id:\\d+>' => 'appointment/<controller>/<action>', 'admin/permit/<controller:\\w+>/<action:(\\w|-)+>' => 'permit/<controller>/<action>', 'admin/permit/<controller:\\w+>/<action:(\\w|-)+>/<id:\\d+>' => 'permit/<controller>/<action>', 'news' => 'news/index', 'documents' => 'collection/view', 'admin/reviews' => 'review/admin', 'admin/review/<id:\\d+>' => 'review/view', 'admin/review/delete/<id:\\d+>' => 'review/delete', 'reviews' => 'review/index', 'review/create' => 'review/create', 'news/<slug:[A-Za-z0-9-_]+>' => 'news/view', '<slug:[A-Za-z0-9-_]+>' => 'page/view']], 'reCaptcha' => ['name' => 'reCaptcha', 'class' => 'himiklab\\yii2\\recaptcha\\ReCaptcha', 'siteKey' => '6LfPPBQTAAAAABUfmtXvJTN63kLhTmTj9iDLlPCH', 'secret' => '6LfPPBQTAAAAAKHaK89OA7SabTX8sFlvTZCSZaFO'], 'authManager' => ['class' => 'yii\\rbac\\DbManager']], 'controllerMap' => ['elfinder' => ['class' => 'mihaildev\\elfinder\\PathController', 'access' => ['@'], 'root' => ['path' => 'files', 'name' => 'Files']]], 'params' => $params, 'as AccessBehavior' => ['class' => AccessBehavior::className(), 'rules' => ['site' => [['actions' => ['error', 'captcha', 'index', 'login', 'logout', 'contact', 'import'], 'allow' => true]], 'news' => [['actions' => ['index', 'view'], 'allow' => true]], 'page' => [['actions' => ['view'], 'allow' => true]], 'block' => [['actions' => ['view'], 'allow' => true]], 'appointment/ticket' => [['actions' => ['entry', 'login', 'view'], 'allow' => true]], 'appointment/ajax' => [['allow' => true]], 'collection' => [['actions' => ['view'], 'allow' => true]], 'review' => [['actions' => ['index'], 'allow' => true]]]]];
if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = ['class' => 'yii\\debug\\Module'];
    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = ['class' => 'yii\\gii\\Module', 'allowedIPs' => ['217.15.19.26']];
}
return $config;
Пример #4
0
<?php

use developeruz\db_rbac\behaviors\AccessBehavior;
$params = (require __DIR__ . '/params.php');
$config = ['language' => 'ru', 'charset' => 'utf-8', 'id' => 'basic', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'components' => ['ipgeobase' => ['class' => 'himiklab\\ipgeobase\\IpGeoBase', 'useLocalDB' => true], 'authManager' => ['class' => 'yii\\rbac\\DbManager'], 'request' => ['cookieValidationKey' => '12345'], 'cache' => ['class' => 'yii\\caching\\FileCache'], 'user' => ['identityClass' => 'app\\models\\User', 'enableAutoLogin' => false], 'errorHandler' => ['errorAction' => 'site/error'], 'mailer' => ['class' => 'yii\\swiftmailer\\Mailer', 'useFileTransport' => true], 'urlManager' => ['showScriptName' => false, 'enablePrettyUrl' => true, 'rules' => ['/register/' => 'site/register', '/login' => '/site/login', '/admin' => '/tree/admin', '/russia/arenda/' => 'arenda/default/index', '/' => '/site/index', '<city:\\D+>/<module:(arenda)\\/?>' => 'arenda/default/index', '<city:\\D+>/arenda/view_ad' => '/arenda/default/view_ad', '<city:\\D+>/arenda/<cat1:\\D+>' => 'arenda/default/index', '<city:\\D+>/arenda/<cat1:\\D+>/<id:\\S+>' => 'arenda/default/view_ad']], 'log' => ['traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [['class' => 'yii\\log\\FileTarget', 'levels' => ['error', 'warning']]]], 'db' => require __DIR__ . '/db.php'], 'modules' => ['permit' => ['class' => 'developeruz\\db_rbac\\Yii2DbRbac', 'params' => ['userClass' => 'app\\models\\User']], 'regions' => ['class' => 'app\\modules\\regions\\regions'], 'tree' => ['class' => 'app\\modules\\Tree\\Tree'], 'arenda' => ['class' => 'app\\modules\\arenda\\arenda']], 'params' => $params, 'as AccessBehavior' => ['class' => AccessBehavior::className(), 'rules' => ['site' => [['actions' => [], 'allow' => true]], 'arenda/default' => [['allow' => true]], 'debug/default' => [['allow' => true]]]]];
if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = ['class' => 'yii\\debug\\Module'];
    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = ['class' => 'yii\\gii\\Module'];
}
return $config;