mix8872/yii2-user-admin
Composer 安装命令:
composer require mix8872/yii2-user-admin
包简介
RBAC Auth manager for Yii2
README 文档
README
This is a fork of mdmsoft/yii2-admin
Installation
Install With Composer
The preferred way to install this extension is through composer.
Either run
php composer.phar require mix8872/yii2-user-admin "dev-master"
Or, you may add
"mix8872/yii2-user-admin": "dev-master"
to the require section of your composer.json file and execute php composer.phar update.
Usage
Once the extension is installed, simply modify your application configuration as follows:
return [ 'modules' => [ 'user-admin' => [ 'class' => 'mix8872\useradmin\Module', ... ] ... ], ... 'as access' => [ 'class' => 'mix8872\useradmin\components\AccessControl', 'allowActions' => [ 'site/*', 'admin/*', 'some-controller/some-action', // The actions listed here will be allowed to everyone including guests. // So, 'admin/*' should not appear here in the production, of course. // But in the earlier stages of your development, you may probably want to // add a lot of actions here until you finally completed setting up rbac, // otherwise you may not even take a first step. ] ], ];
See Yii RBAC for more detail.
If you use database (class 'yii\rbac\DbManager') to save rbac data, execute the migration here:
yii migrate --migrationPath=@yii/rbac/migrations
If you wand add to user fields: img and display_name, execute the migration here:
yii migrate --migrationPath=@vendor/mix8872/user-admin/src/migrations
统计信息
- 总下载量: 713
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2018-11-12