private function getRequestedRoles()
    {
        $rules = $this->config->get('Rules', false);
        if (!$rules) {
            return [];
        }

        // see which of the rules matches the path and extract the requested roles for access
        $returnRoles = [];
        foreach ($rules as $r) {
            $path = $r->get('Path', false);
            if ($path && $this->testPath($path)) {
                $roles = $r->get('Roles', []);
                if ($this->isString($roles)) {
                    $roles = (array)$roles;
                } else {
                    $roles = $roles->toArray();
                }

                // covert the role names to Role instances
                foreach ($roles as $role) {
                    $returnRoles[] = new Role($role);
                }

                return $returnRoles;
            }
        }

        return [];
    }