public function process(ContainerBuilder $container)
    {
        $this->documentMap = $container->get('graviton.document.map');

        $map = [];
        foreach ($this->documentMap->getDocuments() as $document) {
            $restrictionFields = $this->documentMap->getFieldNamesFlat(
                $document,
                '',
                '',
                function ($field) {
                    return $field->getRestrictions();
                },
                true
            );

            $finalRestrictionFields = [];
            foreach ($restrictionFields as $key => $field) {
                // cleanup name! .0. has to be .. for rql!
                $key = preg_replace('@\.([0-9]+)\.@i', '..', $key);
                $finalRestrictionFields[$key] = $field->getRestrictions();
            }

            $map[$document->getClass()] = $finalRestrictionFields;
        }

        $container->setParameter('graviton.document.restriction.fields', $map);
    }