Skip to content

Latest commit

 

History

History
26 lines (25 loc) · 495 Bytes

README.md

File metadata and controls

26 lines (25 loc) · 495 Bytes

调用权

class Test
{
    #[Permission]
    public function test()
    {
        return [1111];
    }
}
class TestController
{
    #[Inject]
    protected Test $test;

    #[Authorize('App\Test::test')]
    public function test()
    {
        // Authorization::authorize('App\Test::test');
        return $this->test->test();
    }
}

当调用#[Permission]声明的代码时, 需要#[Authorize]Authorization::authorize()授权, 否则抛PermissionException