diff --git a/lib/RoadizCoreBundle/config/services.yaml b/lib/RoadizCoreBundle/config/services.yaml index cd1a3e01..1df9cb71 100644 --- a/lib/RoadizCoreBundle/config/services.yaml +++ b/lib/RoadizCoreBundle/config/services.yaml @@ -387,7 +387,7 @@ services: RZ\Roadiz\CoreBundle\Preview\RequestPreviewRevolver: arguments: - '@Symfony\Component\HttpFoundation\RequestStack' - - 'ROLE_BACKEND_USER' + - '%roadiz_core.preview_required_role_name%' RZ\Roadiz\CoreBundle\SearchEngine\ClientRegistry: arguments: ['@service_container'] diff --git a/lib/RoadizCoreBundle/src/DependencyInjection/Configuration.php b/lib/RoadizCoreBundle/src/DependencyInjection/Configuration.php index 8c5134ea..7f5e8948 100644 --- a/lib/RoadizCoreBundle/src/DependencyInjection/Configuration.php +++ b/lib/RoadizCoreBundle/src/DependencyInjection/Configuration.php @@ -38,6 +38,10 @@ public function getConfigTreeBuilder(): TreeBuilder ->scalarNode('maxVersionsShowed') ->defaultValue(10) ->end() + ->scalarNode('previewRequiredRoleName') + ->info('Role name required to access preview mode.') + ->defaultValue('ROLE_BACKEND_USER') + ->end() ->scalarNode('defaultNodeSourceController') ->defaultValue(DefaultNodeSourceController::class) ->end() diff --git a/lib/RoadizCoreBundle/src/DependencyInjection/RoadizCoreExtension.php b/lib/RoadizCoreBundle/src/DependencyInjection/RoadizCoreExtension.php index 94eb4efa..dce12f58 100644 --- a/lib/RoadizCoreBundle/src/DependencyInjection/RoadizCoreExtension.php +++ b/lib/RoadizCoreBundle/src/DependencyInjection/RoadizCoreExtension.php @@ -68,6 +68,7 @@ public function load(array $configs, ContainerBuilder $container): void $container->setParameter('roadiz_core.hide_roadiz_version', $config['hideRoadizVersion']); $container->setParameter('roadiz_core.use_accept_language_header', $config['useAcceptLanguageHeader']); $container->setParameter('roadiz_core.web_response_class', $config['webResponseClass']); + $container->setParameter('roadiz_core.preview_required_role_name', $config['previewRequiredRoleName']); /* * Assets config