|
20 | 20 | /**
|
21 | 21 | * @see \Casbin\Enforcer
|
22 | 22 | * @mixin Enforcer
|
23 |
| - * @method static enforce(mixed ...$rvals) 权限检查,输入参数通常是(sub, obj, act) |
| 23 | + * @method static bool enforce(mixed ...$rvals) 权限检查,输入参数通常是(sub, obj, act) |
24 | 24 | * @method static bool addPolicy(mixed ...$params) 当前策略添加授权规则
|
25 | 25 | * @method static bool addPolicies(mixed ...$params) 当前策略添加授权规则
|
26 | 26 | * @method static bool hasPolicy(mixed ...$params) 确定是否存在授权规则
|
27 | 27 | * @method static bool removePolicy(mixed ...$params) 当前策略移除授权规则
|
28 |
| - * @method static getAllRoles() 获取所有角色 |
29 |
| - * @method static getPolicy() 获取所有的角色的授权规则 |
30 |
| - * @method static getRolesForUser(string $name, string ...$domain) 获取用户具有的角色 |
31 |
| - * @method static getUsersForRole(string $name, string ...$domain) 获取具有角色的用户 |
32 |
| - * @method static hasRoleForUser(string $name, string $role, string ...$domain) 确定用户是否具有角色 |
33 |
| - * @method static addRoleForUser(string $user, string $role, string ...$domain) 给用户添加角色 |
34 |
| - * @method static addPermissionForUser(string $user, string ...$permission) 赋予权限给某个用户或角色 |
35 |
| - * @method static deleteRoleForUser(string $user, string $role, string $domain) 删除用户的角色 |
36 |
| - * @method static deleteRolesForUser(string $user, string ...$domain) 删除某个用户的所有角色 |
37 |
| - * @method static deleteRole(string $role) 删除单个角色 |
38 |
| - * @method static deletePermission(string ...$permission) 删除权限 |
39 |
| - * @method static deletePermissionForUser(string $name, string $permission) 删除用户或角色的权限。如果用户或角色没有权限则返回 false(不会受影响)。 |
40 |
| - * @method static deletePermissionsForUser(string $name) 删除用户或角色的权限。如果用户或角色没有任何权限(也就是不受影响),则返回false。 |
41 |
| - * @method static getPermissionsForUser(string $name) 获取用户或角色的所有权限 |
42 |
| - * @method static hasPermissionForUser(string $user, string ...$permission) 决定某个用户是否拥有某个权限 |
43 |
| - * @method static getImplicitRolesForUser(string $name, string ...$domain) 获取用户具有的隐式角色 |
44 |
| - * @method static getImplicitPermissionsForUser(string $username, string ...$domain) 获取用户具有的隐式权限 |
45 |
| - * @method static addFunction(string $name, \Closure $func) 添加一个自定义函数 |
| 28 | + * @method static array getAllRoles() 获取所有角色 |
| 29 | + * @method static array getPolicy() 获取所有的角色的授权规则 |
| 30 | + * @method static bool updatePolicies(array $oldPolices, array $newPolicies) 更新策略 |
| 31 | + * @method static bool removePolicies(array $rules) 删除策略 |
| 32 | + * @method static array getRolesForUser(string $name, string ...$domain) 获取用户具有的角色 |
| 33 | + * @method static array getUsersForRole(string $name, string ...$domain) 获取具有角色的用户 |
| 34 | + * @method static bool hasRoleForUser(string $name, string $role, string ...$domain) 确定用户是否具有角色 |
| 35 | + * @method static bool addRoleForUser(string $user, string $role, string ...$domain) 给用户添加角色 |
| 36 | + * @method static bool addRolesForUser(string $user, array $roles, string ...$domain) |
| 37 | + * @method static bool addPermissionForUser(string $user, string ...$permission) 赋予权限给某个用户或角色 |
| 38 | + * @method static bool addPermissionsForUser(string $user, array ...$permissions) 赋予用户或角色多个权限。 如果用户或角色已经有一个权限,则返回 false (不会受影响) |
| 39 | + * @method static bool deleteRoleForUser(string $user, string $role, string $domain) 删除用户的角色 |
| 40 | + * @method static bool deleteUser(string $user) 删除用户 |
| 41 | + * @method static bool deleteRolesForUser(string $user, string ...$domain) 删除某个用户的所有角色 |
| 42 | + * @method static bool deleteRole(string $role) 删除单个角色 |
| 43 | + * @method static bool deletePermission(string ...$permission) 删除权限 |
| 44 | + * @method static bool deletePermissionForUser(string $name, string $permission) 删除用户或角色的权限。如果用户或角色没有权限则返回 false(不会受影响)。 |
| 45 | + * @method static bool deletePermissionsForUser(string $name) 删除用户或角色的权限。如果用户或角色没有任何权限(也就是不受影响),则返回false。 |
| 46 | + * @method static array getPermissionsForUser(string $name) 获取用户或角色的所有权限 |
| 47 | + * @method static bool hasPermissionForUser(string $user, string ...$permission) 决定某个用户是否拥有某个权限 |
| 48 | + * @method static array getImplicitRolesForUser(string $name, string ...$domain) 获取用户具有的隐式角色 |
| 49 | + * @method static array getImplicitPermissionsForUser(string $username, string ...$domain) 获取用户具有的隐式权限 |
| 50 | + * @method static array getImplicitUsersForRole(string $name, string ...$domain) 获取具有隐式用户的角色 |
| 51 | + * @method static array getImplicitResourcesForUser(string $user, string ...$domain) 获取具有隐式资源的用户 |
| 52 | + * @method static array getImplicitUsersForPermission(string ...$permission) 获取隐式用户的权限 |
| 53 | + * @method static array getAllUsersByDomain(string $domain) 获取域中的所有用户 |
| 54 | + * @method static array getUsersForRoleInDomain(string $name, string $domain) 获取在域内具有传入角色的用户 |
| 55 | + * @method static array getRolesForUserInDomain(string $name, string $domain) 获取域中用户具有的所有角色 |
| 56 | + * @method static array getPermissionsForUserInDomain(string $name, string $domain) 获取域中用户具有的所有权限 |
| 57 | + * @method static bool addRoleForUserInDomain(string $user, string $role, string $domain) 给域中的用户添加角色 |
| 58 | + * @method static bool deleteRoleForUserInDomain(string $user, string $role, string $domain) 删除域中用户的角色 |
| 59 | + * @method static bool deleteRolesForUserInDomain(string $user, string $domain) 删除域中用户的所有角色 |
| 60 | + * @method static bool deleteAllUsersByDomain(string $domain) 删除域中的所有用户 |
| 61 | + * @method static bool deleteDomains(string ...$domain) 删除域 |
| 62 | + * @method static bool addFunction(string $name, \Closure $func) 添加一个自定义函数 |
46 | 63 | */
|
47 | 64 | class Permission
|
48 | 65 | {
|
|
0 commit comments