Answer the question
In order to leave comments, you need to log in
How to create rules in dektrium rbac for Yii2?
Hello. Installed dektrium/yii2-rbac
and dektrium/yii2-user
backend
config:
'components' => [
'user' => [
'identityClass' => 'common\models\User',
'identityCookie' => [
'name' => '_backendIdentity',
'path' => '/admin',
'httpOnly' => true,
],
],
'session' => [
'name' => 'BACKENDSESSID',
'cookieParams' => [
'httpOnly' => true,
'path' => '/admin',
],
],
'modules' => [
'user' => [
'as backend' => 'dektrium\user\filters\BackendFilter',
],
'rbac' => [
'class' => 'dektrium\rbac\Module',
],
],
'user' => [
'enableAutoLogin' => true,
'identityClass' => 'common\models\User',
'identityCookie' => [
'name' => '_frontendIdentity',
'path' => '/',
'httpOnly' => true,
],
],
'session' => [
'name' => 'FRONTENDSESSID',
'cookieParams' => [
'httpOnly' => true,
'path' => '/',
],
],
'modules' => [
'user' => [
// following line will restrict access to admin controller from frontend application
'as frontend' => 'dektrium\user\filters\FrontendFilter',
],
'rbac' => [
'class' => 'dektrium\rbac\Module',
],
],
'user' => [
'class' => 'dektrium\user\Module',
'admins' => ['root'],
'confirmWithin' => 21600,
'cost' => 12,
'enableConfirmation' => false, // @TODO remove this
],
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question