public function getRoles($name, ...$domain)
    {
        if (1 == \count($domain)) {
            $name = $domain[0].'::'.$name;
        } elseif (\count($domain) > 1) {
            throw new CasbinException('error: domain should be 1 parameter');
        }

        if (!$this->hasRole($name)) {
            return [];
        }

        $roles = $this->createRole($name)->getRoles();
        if (1 == \count($domain)) {
            foreach ($roles as $key => $value) {
                $roles[$key] = \array_slice($roles[$key], \strlen($domain[0]) + 2);
            }
        }

        return $roles;
    }