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;
    }
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;
    }
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 ; }
gets the roles that a subject inherits.
domain is a prefix to the roles.

@param string $name
@param mixed  ...$domain

@return array

@throws CasbinException
gets the roles that a subject inherits . domain is a prefix to the roles .