55
66An authorization library that supports access control models like ACL, RBAC, ABAC for webman plugin
77
8- ## Requirements
8+ ## 依赖
99
10- ### common
11-
12- - [ PHP-DI] ( https://github.com/PHP-DI/PHP-DI )
1310- [ ThinkORM] ( https://www.workerman.net/doc/webman/db/others.html ) (默认)
11+ - [ PHP-DI] ( https://github.com/PHP-DI/PHP-DI )
1412- [ illuminate/database] ( https://www.workerman.net/doc/webman/db/tutorial.html ) (可选)
1513
16- ## Installation
14+ ## 安装
1715
1816``` sh
1917composer require casbin/webman-permission
2018```
2119
22- ## Configure
20+ ## 使用
2321
24- ### 1、DI
22+ ### 1. 依赖注入配置
2523
26- configure ` config/container.php ` ,Its final content is as follows :
24+ 修改配置 ` config/container.php ` ,其最终内容如下 :
2725
2826``` php
2927$builder = new \DI\ContainerBuilder();
@@ -32,17 +30,19 @@ $builder->useAutowiring(true);
3230return $builder->build();
3331```
3432
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
3636
37- #### (1) 模型配置
37+ 🚀 ** (1) 模型配置**
3838
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适配器
4444
45- #### (2) 创建 ` casbin_rule ` 数据表
45+ 🔰 ** (2) 创建 ` casbin_rule ` 数据表**
4646``` sql
4747CREATE TABLE `casbin_rule ` (
4848 ` id` BIGINT ( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -64,7 +64,7 @@ CREATE TABLE `casbin_rule` (
6464) ENGINE = INNODB CHARSET = utf8mb4 COMMENT = ' 策略规则表' ;
6565```
6666
67- #### (3) 配置 ` config/redis ` 配置
67+ 📚 ** (3) 配置 ` config/redis ` 配置**
6868
6969## 重启webman
7070
0 commit comments