sunxyw / policy
This package is abandoned and no longer maintained.
No replacement package was suggested.
There is no license information available for the latest version (v1.0.0) of this package.
v1.0.0
2022-03-22 15:10 UTC
README
一个非常简单的,用于炸毛框架的基础权限控制库。
使用方法
composer require sunxyw/policy
在 OnStart
方法中:
#[OnStart] public function init() { \Sunxyw\Policy\Gate::define('can_view_timer', static function ($params) { return false; }); }
use Sunxyw\Policy\Annotations\Gate; #[CQCommand('view_timer')] #[Gate('can_view_timer', 'any_param_here')] public function timer() { return 'This page is used as testing TimerMiddleware! Do not use it in production.'; }