hiraeth / auth
Hiraeth Nano-Framework 的 RBAC/ACL 认证
3.0-beta
2024-03-15 19:02 UTC
Requires
- hiraeth/app: ^3.0
- hiraeth/signal: ^3.0
- imarc/auth: ^2.0
Requires (Dev)
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2024-09-15 20:05:19 UTC
README
Imarc 的 RBAC/ACL 实现 提供了强大的基于角色的认证和权限配置,这些权限可以在任何实体上动态检查,同时提供基于配置的访问控制列表。
安装
composer require hiraeth/auth
通过 opus,auth.jin
配置将被自动复制到您的 config
目录。
委派
此软件包不包含任何委派。
提供者
配置
[auth] ; Aliases enable to combination of multiple permitted actions into a single ; action. The key is the alias for the actions and the value is an array of ; actions which it also permits. aliases = { ; "manage": ["create", "read", "update", "delete"] } ; Access control lists. Each entry in the acls list is keyed by the role. ; The value is then an object containing permitted actions (arrays of actions) ; for the keyed targets. acls = { ; "admin": { ; "User" : ["manage"] ; } }
[auth]
部分是全局认可的,因此可以将其添加到系统中的任何配置文件以添加额外的角色和权限。每个 [auth]
部分构成一个独立的 ACL,因此别名仅适用于同一部分中定义的 ACL。
用法
有关如何使用认证管理器和检查角色/权限的更多信息,请参阅 Auth 文档。