Skip to content

Commit

Permalink
Model 配置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinywan committed Mar 23, 2022
1 parent eb39fd0 commit 30f7b2e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ An authorization library that supports access control models like ACL, RBAC, ABA
## Installation

```sh
composer require tinywan/casbin
composer require casbin/webman-permission
```

## Configure
Expand Down
6 changes: 3 additions & 3 deletions src/Model/RuleModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class RuleModel extends Model implements Arrayable
* @access public
* @param array $data 数据
*/
public function __construct($data = [])
public function __construct(array $data = [])
{
$this->connection = $this->config('database.connection') ?: '';
$this->table = $this->config('database.rules_table');
Expand All @@ -57,7 +57,7 @@ public function __construct($data = [])
*/
protected function config(string $key = null, $default = null)
{
$driver = config('plugin.tinywan.casbin.permission.default');
return config('plugin.tinywan.casbin.permission.' . $driver . '.' . $key, $default);
$driver = config('plugin.casbin.webman-permission.permission.default');
return config('plugin.casbin.webman-permission.permission.' . $driver . '.' . $key, $default);
}
}
4 changes: 2 additions & 2 deletions src/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
class Permission implements Bootstrap
{
/**
* @var $_manager
* @var Enforcer|null $_manager
*/
protected static $_manager = null;
protected static ?Enforcer $_manager = null;

/**
* @param Worker $worker
Expand Down
2 changes: 1 addition & 1 deletion src/config/plugin/casbin/webman-permission/permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Model 设置
'model' => [
'config_type' => 'file',
'config_file_path' => config_path() . '/plugin/tinywan/casbin/rbac-model.conf',
'config_file_path' => config_path() . '/plugin/casbin/webman-permission/rbac-model.conf',
'config_text' => '',
],
# 适配器
Expand Down

0 comments on commit 30f7b2e

Please sign in to comment.