|
7 | 7 | use Casbin\Enforcer;
|
8 | 8 | use Casbin\Model\Model;
|
9 | 9 |
|
| 10 | +/** |
| 11 | + * @see Enforcer |
| 12 | + * @mixin Enforcer |
| 13 | + * @method mixed GetRolesForUser(string $username) static 获取用户具有的角色 |
| 14 | + * @method mixed GetUsersForRole(string $role) static 获取具有角色的用户 |
| 15 | + * @method mixed HasRoleForUser(string $username, string $role) static 确定用户是否具有角色 |
| 16 | + * @method mixed AddRoleForUser(string $username, string $role) static 为用户添加角色 |
| 17 | + * @method mixed DeleteRoleForUser(string $username, string $role) static 删除用户的角色 |
| 18 | + * @method mixed DeleteRolesForUser(string $username) static 删除用户的所有角色 |
| 19 | + * @method mixed DeleteUser(string $username) static 删除一个用户 |
| 20 | + * @method mixed DeleteRole(string $role) static 删除一个角色 |
| 21 | + * @method mixed DeletePermission(string $policy) static 删除权限 |
| 22 | + * @method mixed AddPermissionForUser(string $username,string $policy) static 为用户或角色添加权限 |
| 23 | + * @method mixed DeletePermissionForUser(string $username,string $policy) static 删除用户或角色的权限 |
| 24 | + * @method mixed DeletePermissionsForUser(string $username) static 删除用户或角色的权限 |
| 25 | + * @method mixed GetPermissionsForUser(string $username) static 获取用户或角色的权限 |
| 26 | + * @method mixed HasPermissionForUser(string $username,string $policy) static 确定用户是否具有权限 |
| 27 | + * @method mixed GetImplicitRolesForUser(string $username) static 获取用户具有的隐式角色 |
| 28 | + * @method mixed GetImplicitPermissionsForUser(string $username) static 获取用户具有的隐式角色 |
| 29 | + */ |
10 | 30 | class Casbin extends Facade
|
11 | 31 | {
|
12 | 32 | protected static function getFacadeClass()
|
13 | 33 | {
|
14 | 34 | if (!Container::getInstance()->has('casbin')) {
|
15 | 35 | Container::getInstance()->bindTo('casbin', function () {
|
16 | 36 | $adapter = config('casbin.adapter');
|
17 |
| - |
18 | 37 | $configType = config('casbin.model.config_type');
|
19 |
| - |
20 | 38 | $model = new Model();
|
21 | 39 | if ('file' == $configType) {
|
22 | 40 | $model->loadModel(config('casbin.model.config_file_path'));
|
|
0 commit comments