mix8872 / yii2-user-admin
Yii2 RBAC 权限管理器
v1.0.1
2020-10-21 08:26 UTC
Requires
- kartik-v/yii2-password: @dev
- yiisoft/yii2: ~2.0.4
Suggests
- yiisoft/yii2-bootstrap: Used when using layout 'left-menu', 'right-menu' or 'top-menu'
This package is not auto-updated.
Last update: 2024-09-30 00:39:40 UTC
README
这是 mdmsoft/yii2-admin 的分支
- 变更日志.
安装
使用 Composer 安装
推荐通过 composer 安装此扩展。
运行以下命令
php composer.phar require mix8872/yii2-user-admin "dev-master"
或者,你也可以在 composer.json
文件的 require 部分添加
"mix8872/yii2-user-admin": "dev-master"
并执行 php composer.phar update
。
使用方法
扩展安装后,只需按以下方式修改你的应用程序配置
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. ] ], ];
有关更多详细信息,请参阅 Yii RBAC。
如果你使用数据库(类 'yii\rbac\DbManager')来保存 RBAC 数据,请在此处执行迁移
yii migrate --migrationPath=@yii/rbac/migrations
如果你想添加到用户字段:img 和 display_name,请在此处执行迁移
yii migrate --migrationPath=@vendor/mix8872/user-admin/src/migrations