Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glynnforrest/symfony-recipes-issue-829
https://github.com/glynnforrest/symfony-recipes-issue-829
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/glynnforrest/symfony-recipes-issue-829
- Owner: glynnforrest
- Created: 2020-10-03T10:37:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-03T10:40:24.000Z (over 4 years ago)
- Last Synced: 2024-11-05T13:51:53.705Z (2 months ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
See https://github.com/symfony/recipes/issues/829
```bash
composer install
```Note that `access_decision_manager.strategy` is set to `unanimous` in `config/packages/security.yaml`.
```bash
./bin/console debug:config security access_decision_manager# Current configuration for "security.access_decision_manager"
# ============================================================
#
# strategy: affirmative
# allow_if_all_abstain: false
# allow_if_equal_granted_denied: true
``````bash
APP_ENV=prod ./bin/console cache:clear
APP_ENV=prod ./bin/console debug:config security access_decision_manager# Current configuration for "security.access_decision_manager"
# ============================================================
#
# strategy: unanimous
# allow_if_all_abstain: false
# allow_if_equal_granted_denied: true
```Now swap the file loading order in `src/Kernel.php`:
```diff
protected function configureContainer(ContainerConfigurator $container): void
{
// Default order
- $container->import('../config/{packages}/*.yaml');
- $container->import('../config/{packages}/'.$this->environment.'/*.yaml');
+ // $container->import('../config/{packages}/*.yaml');
+ // $container->import('../config/{packages}/'.$this->environment.'/*.yaml');// If loaded in this order an exception is (rightfully) thrown
// "You are not allowed to define new elements for path
// "security.firewalls". Please define all elements for this path in
// one config file."
- // $container->import('../config/{packages}/'.$this->environment.'/*.yaml');
- // $container->import('../config/{packages}/*.yaml');
+ $container->import('../config/{packages}/'.$this->environment.'/*.yaml');
+ $container->import('../config/{packages}/*.yaml');if (is_file(\dirname(__DIR__).'/config/services.yaml')) {
$container->import('../config/services.yaml');
```Dump the security config for `APP_ENV=dev` again.
We get an error this time, which is expected.```bash
./bin/console debug:config security access_decision_manager# In PrototypedArrayNode.php line 303:
#
# You are not allowed to define new elements for path "security.firewalls". Please define all elements for this path in one config file.
```