template/extension/AuthorizationExtension.php
public function hasRoles(string ...$roles)
    {
        /**
         *
         * @var UserTokenInterface $UserToken
         */
        $UserToken      = $this->Template->getContainer()->get(UserTokenInterface::class);
        $user_roles     = $UserToken->getUser()->getRoles();
        $diffed_roles   = array_diff($user_roles, $roles);
        return count($user_roles) > count($diffed_roles);
    }
public function hasRoles(string ...$roles)
    {
        /**
         *
         * @var UserTokenInterface $UserToken
         */
        $UserToken      = $this->Template->getContainer()->get(UserTokenInterface::class);
        $user_roles     = $UserToken->getUser()->getRoles();
        $diffed_roles   = array_diff($user_roles, $roles);
        return count($user_roles) > count($diffed_roles);
    }
*
判断当前用户是否包含这些角色

@param string ...$roles
@return boolean