• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

php-casbin / think-authz / 15025144079

14 May 2025 03:44PM UTC coverage: 92.667%. Remained the same
15025144079

Pull #52

github

web-flow
Merge db5c61a49 into 6639f0fd9
Pull Request #52: fix: delete without condition if cache disabled

1 of 1 new or added line in 1 file covered. (100.0%)

139 of 150 relevant lines covered (92.67%)

48.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/facade/Enforcer.php
1
<?php
2

3
namespace tauthz\facade;
4

5
use think\Facade;
6

7
/**
8
 * @see \Casbin\Enforcer
9
 * @package tauthz\facade
10
 * @mixin \Casbin\Enforcer
11
 * @method static bool enforce(mixed ...$rvals) 权限检查,输入参数通常是(sub, obj, act)
12
 * @method static bool addPolicy(mixed ...$params) 当前策略添加授权规则
13
 * @method static bool hasPolicy(mixed ...$params) 确定是否存在授权规则
14
 * @method static bool removePolicy(mixed ...$params) 当前策略移除授权规则
15
 * @method static array getRolesForUser(string $username, string ...$domain) 获取用户具有的角色
16
 * @method static array getUsersForRole(string $role, string ...$domain) 获取具有角色的用户
17
 * @method static bool hasRoleForUser(string $username, string $role, string ...$domain) 确定用户是否具有角色
18
 * @method static bool addRoleForUser(string $username, string $role, string ...$domain) 为用户添加角色
19
 * @method static bool deleteRoleForUser(string $username, string $role, string ...$domain) 删除用户的角色
20
 * @method static bool deleteRolesForUser(string $username, string ...$domain) 删除用户的所有角色
21
 * @method static bool deleteUser(string $username) 删除一个用户
22
 * @method static bool deleteRole(string $role) 删除一个角色
23
 * @method static bool deletePermission(string ...$permission) 删除权限
24
 * @method static bool addPermissionForUser(string $username, string ...$permission) 为用户或角色添加权限
25
 * @method static bool deletePermissionForUser(string $username, string ...$permission) 删除用户或角色的权限
26
 * @method static bool deletePermissionsForUser(string $username) 删除用户或角色的权限
27
 * @method static array getPermissionsForUser(string $username) 获取用户或角色的权限
28
 * @method static bool hasPermissionForUser(string $username, string ...$permission) 确定用户是否具有权限
29
 * @method static array getImplicitRolesForUser(string $username, string ...$domain) 获取用户具有的隐式角色
30
 * @method static array getImplicitPermissionsForUser(string $username, string ...$domain) 获取用户具有的隐式权限
31
 * @method static addFunction(string $name, \Closure $func) 添加一个自定义函数
32
 */
33
class Enforcer extends Facade
34
{
35
    /**
36
     * 获取当前 Facade 对应类名(或者已经绑定的容器对象标识)
37
     * 
38
     * @access protected
39
     * @return string
40
     */
41
    protected static function getFacadeClass()
42
    {
43
        return 'enforcer';
108✔
44
    }
45
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc