sunxyw/policy

该软件包已被废弃,不再维护。没有建议的替代软件包。
关于该软件包最新版本(v1.0.0)没有可用的许可信息。

v1.0.0 2022-03-22 15:10 UTC

This package is auto-updated.

Last update: 2022-05-23 10:13:40 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.';
}