5
5
6
6
An authorization library that supports access control models like ACL, RBAC, ABAC for webman plugin
7
7
8
- ## Requirements
8
+ ## 依赖
9
9
10
- ### common
11
-
12
- - [ PHP-DI] ( https://github.com/PHP-DI/PHP-DI )
13
10
- [ ThinkORM] ( https://www.workerman.net/doc/webman/db/others.html ) (默认)
11
+ - [ PHP-DI] ( https://github.com/PHP-DI/PHP-DI )
14
12
- [ illuminate/database] ( https://www.workerman.net/doc/webman/db/tutorial.html ) (可选)
15
13
16
- ## Installation
14
+ ## 安装
17
15
18
16
``` sh
19
17
composer require casbin/webman-permission
20
18
```
21
19
22
- ## Configure
20
+ ## 使用
23
21
24
- ### 1、DI
22
+ ### 1. 依赖注入配置
25
23
26
- configure ` config/container.php ` ,Its final content is as follows :
24
+ 修改配置 ` config/container.php ` ,其最终内容如下 :
27
25
28
26
``` php
29
27
$builder = new \DI\ContainerBuilder();
@@ -32,17 +30,19 @@ $builder->useAutowiring(true);
32
30
return $builder->build();
33
31
```
34
32
35
- ### 2、Database configuration
33
+ ### 2. 数据库配置
34
+
35
+ > 默认策略存储是使用的ThinkORM,如使用[ laravel的数据库] ( https://learnku.com/docs/laravel/8.x/eloquent/9400 ) 的 [ illuminate/database] ( https://github.com/illuminate/database ) ,请按照官方文档按照相应的依赖包:https://www.workerman.net/doc/webman/db/tutorial.html
36
36
37
- #### (1) 模型配置
37
+ 🚀 ** (1) 模型配置**
38
38
39
- - 使用ThinkORM(默认)
40
- - 修改数据库 ` thinkorm.php ` 配置
41
- - 使用laravel数据库(可选)
42
- - 修改数据库 ` database.php ` 配置
43
- - 修改数据库 ` permission.php ` 的` adapter ` 适配器为laravel适配器
39
+ - 📒📒📒 使用ThinkORM(默认)
40
+ - 修改数据库 ` thinkorm.php ` 配置
41
+ - 📕📕📕 使用laravel数据库(可选)
42
+ - 修改数据库 ` database.php ` 配置
43
+ - 修改数据库 ` permission.php ` 的` adapter ` 适配器为laravel适配器
44
44
45
- #### (2) 创建 ` casbin_rule ` 数据表
45
+ 🔰 ** (2) 创建 ` casbin_rule ` 数据表**
46
46
``` sql
47
47
CREATE TABLE `casbin_rule ` (
48
48
` id` BIGINT ( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -64,7 +64,7 @@ CREATE TABLE `casbin_rule` (
64
64
) ENGINE = INNODB CHARSET = utf8mb4 COMMENT = ' 策略规则表' ;
65
65
```
66
66
67
- #### (3) 配置 ` config/redis ` 配置
67
+ 📚 ** (3) 配置 ` config/redis ` 配置**
68
68
69
69
## 重启webman
70
70
0 commit comments