Skip to content

assert6/hyperf-permission

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

调用权

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

About

调用权

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages