PermHandler.php 468 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
<?php
/**
 * Created by PhpStorm.
 * User: Zero
 * Date: 2020/4/8
 * Time: 16:12
 */

namespace Meibuyu\Micro\Handler;

use Hyperf\Di\Annotation\Inject;
use Meibuyu\Micro\Model\Auth;
use Meibuyu\Micro\Service\Interfaces\UserServiceInterface;

class PermHandler
{

    /**
     * @Inject()
     * @var UserServiceInterface
     */
    protected $userServer;

    public function check($perm)
    {
        return $this->userServer->checkPerm(Auth::id(), $perm);
    }
}