onix-systems-php/hyperf-policy
最新稳定版本:v1.2.0
Composer 安装命令:
composer require onix-systems-php/hyperf-policy
包简介
Policy library for hyperf
README 文档
README
Uses Symfony-like voters to check permissions
Install:
composer require onix-systems-php/hyperf-policy
To make it works, you need:
-
create policy class based on
OnixSystemsPHP\HyperfPolicy\Policy\AbstractPolicy -
add
OnixSystemsPHP\HyperfPolicy\Annotation\Policyannotation to the policy and setup it's priority (higher number executes first) -
specify what classes\objects and actions your policy will work with
-
specify vote logic and return one of the values:
PolicyVote::ACCESS_DENIED- stop execution and throw exception specified ingetExceptionmethodPolicyVote::ACCESS_GRANTED- allow current action and skip all following policiesPolicyVote::ACCESS_ABSTAIN- go to next policy, allow action if no policies left to check
-
create data specifier class based on
OnixSystemsPHP\HyperfPolicy\Policy\AbstractDataSpecifier -
add
OnixSystemsPHP\HyperfPolicy\Annotation\DataSpecifierannotation to the specifier and setup it's priority (higher number executes first) -
specify what repositories and actions your specifier will work with
统计信息
- 总下载量: 2.49k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-13