dev-master
9999999-devRBAC manager for Yii framework
The Requires
by wsdslm
1.0.0
1.0.0.0RBAC manager for Yii framework
The Requires
by wsdslm
RBAC manager for Yii framework
via Composer, (*1)
composer require wsdslm/yii2-rbac
# config/web.php 'components' => [ 'authManager' => [ 'class' => yii\rbac\DbManager::className(), ] ], 'modules' => [ 'rbac' => [ 'class' => ws\rbac\Module::className(), ] ],
database migration, (*2)
yii migrate --migrationPath=@yii/rbac/migrations
add ws\rbac\components\RouteAccessFilter
for app\controllers\SiteController
, (*3)
use ws\rbac\components\RouteAccessFilter; public function behaviors() { return [ 'rbac' => [ 'class' => RouteAccessFilter::className(), 'only' => ['t'], ], ]; } public function actionT() { return __METHOD__; }
Create Route access Permission at http://localhost:8080/rbac/permission/create
, (*4)
basic.site.t
(module_id.controller_id.action_id
)http://localhost:8080/rbac/role/create
admin
http://localhost:8080/rbac/role/index
basic.site.t
http://localhost:8080/rbac/assign
RBAC manager for Yii framework
RBAC manager for Yii framework