Skip to content

Commit

Permalink
feat(CoreBundle): Made preview required RoleName configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Jun 6, 2024
1 parent 86f218e commit 1f94711
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/RoadizCoreBundle/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f94711

Please sign in to comment.