Skip to content

Commit 0b3ff0c

Browse files
authored
Merge pull request #9 from windhoney/develop
no message
2 parents 91bb202 + 880ebe2 commit 0b3ff0c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# yii2-rest-rbac
22

3-
43
> Yii2权限系统,rest版,根据[yii2-admin(https://github.com/mdmsoft/yii2-admin)](https://github.com/mdmsoft/yii2-admin)修改
54
6-
75
### **使用**
86

97
* **配置oauth2和rbac**
@@ -43,30 +41,34 @@
4341
'class' => 'wind\rest\components\AccessControl',
4442
'allowActions' => [
4543
'site/*',//允许访问的节点,可自行添加
46-
'rbac/menu/user-menu',//允许所有人访问admin节点及其子节点
47-
'oauth2/*',//允许所有人访问admin节点及其子节点
44+
'rbac/menu/user-menu',
45+
'oauth2/*',
4846
]
4947
],
5048
```
5149

5250

5351
* **创建所需要的表**
54-
```
5552
//用户表user和菜单表menu
53+
```php
5654
yii migrate --migrationPath=@vendor/windhoney/yii2-rest-rbac/migrations
55+
```
5756
//rbac相关权限表
57+
```php
5858
yii migrate --migrationPath=@yii/rbac/migrations/
59+
```
5960
//oauth2相关表
61+
```php
6062
yii migrate --migrationPath=@vendor/filsh/yii2-oauth2-server/migrations
6163
```
6264

6365
* **添加路由配置**
6466

6567
将yii2-rest-rbac/example/rbac_route.php文件内容配置到项目的urlManager的rules规则下
6668
也可在main.php文件中 添加
67-
```
69+
```php
6870
$dir = __DIR__ . "/route";
69-
$main = RbacHelper::addRoute($dir, $main);
71+
$main = wind\rest\helper\RbacHelper::addRoute($dir, $main);
7072
return $main;
7173
```
7274
直接将此文件放到config/route/rbac_route.php

0 commit comments

Comments
 (0)