Skip to content

Commit 30f7b2e

Browse files
committed
Model 配置文件
1 parent eb39fd0 commit 30f7b2e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ An authorization library that supports access control models like ACL, RBAC, ABA
1717
## Installation
1818

1919
```sh
20-
composer require tinywan/casbin
20+
composer require casbin/webman-permission
2121
```
2222

2323
## Configure

src/Model/RuleModel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class RuleModel extends Model implements Arrayable
3939
* @access public
4040
* @param array $data 数据
4141
*/
42-
public function __construct($data = [])
42+
public function __construct(array $data = [])
4343
{
4444
$this->connection = $this->config('database.connection') ?: '';
4545
$this->table = $this->config('database.rules_table');
@@ -57,7 +57,7 @@ public function __construct($data = [])
5757
*/
5858
protected function config(string $key = null, $default = null)
5959
{
60-
$driver = config('plugin.tinywan.casbin.permission.default');
61-
return config('plugin.tinywan.casbin.permission.' . $driver . '.' . $key, $default);
60+
$driver = config('plugin.casbin.webman-permission.permission.default');
61+
return config('plugin.casbin.webman-permission.permission.' . $driver . '.' . $key, $default);
6262
}
6363
}

src/Permission.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
class Permission implements Bootstrap
4949
{
5050
/**
51-
* @var $_manager
51+
* @var Enforcer|null $_manager
5252
*/
53-
protected static $_manager = null;
53+
protected static ?Enforcer $_manager = null;
5454

5555
/**
5656
* @param Worker $worker

src/config/plugin/casbin/webman-permission/permission.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Model 设置
1111
'model' => [
1212
'config_type' => 'file',
13-
'config_file_path' => config_path() . '/plugin/tinywan/casbin/rbac-model.conf',
13+
'config_file_path' => config_path() . '/plugin/casbin/webman-permission/rbac-model.conf',
1414
'config_text' => '',
1515
],
1616
# 适配器

0 commit comments

Comments
 (0)