From e0ee58ba2d8a2edf94e2dfb49a9d792617592af1 Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Thu, 16 Jul 2020 16:59:57 +0200 Subject: [PATCH] Automatically include needed services and routes --- README.md | 27 +-------------------------- config/routes.yaml | 3 +++ config/services.yaml | 13 +++++++++++++ 3 files changed, 17 insertions(+), 26 deletions(-) create mode 100644 config/routes.yaml create mode 100644 config/services.yaml diff --git a/README.md b/README.md index 105c48a..ee14c9e 100644 --- a/README.md +++ b/README.md @@ -10,37 +10,12 @@ Here is a list of things that the extension allows: ## Installation -To install this extension, simply run the following in your root folder: +To install this extension, simply run the following terminal command from your root folder: ``` composer require bolt/users ``` -Then, add the following to your `config/services.yaml` file: - -```yaml - Bolt\UsersExtension\Exclude\ProtectedListingController: - decorates: Bolt\Controller\Frontend\ListingController - arguments: ['@.inner'] - tags: ['controller.service_arguments'] - - Bolt\UsersExtension\Exclude\ProtectedDetailController: - decorates: Bolt\Controller\Frontend\DetailController - arguments: ['@.inner'] - tags: ['controller.service_arguments'] - - Bolt\UsersExtension\Controller\AccessAwareController: - tags: ['controller.service_arguments'] -``` - -Finally, add this to `config/routes.yaml`: - -```yaml -users_extension_controllers: - resource: '../../vendor/bolt/users/src/' - type: annotation -``` - ## Basic usage To limit a a ContentType to a specific group of users, say `ROLE_MEMBER`, do the following: diff --git a/config/routes.yaml b/config/routes.yaml new file mode 100644 index 0000000..d078dab --- /dev/null +++ b/config/routes.yaml @@ -0,0 +1,3 @@ +users_extension_controllers: + resource: '../vendor/bolt/users/src/' + type: annotation diff --git a/config/services.yaml b/config/services.yaml new file mode 100644 index 0000000..4868fc4 --- /dev/null +++ b/config/services.yaml @@ -0,0 +1,13 @@ +services: + Bolt\UsersExtension\Exclude\ProtectedListingController: + decorates: Bolt\Controller\Frontend\ListingController + arguments: ['@.inner'] + tags: ['controller.service_arguments'] + + Bolt\UsersExtension\Exclude\ProtectedDetailController: + decorates: Bolt\Controller\Frontend\DetailController + arguments: ['@.inner'] + tags: ['controller.service_arguments'] + + Bolt\UsersExtension\Controller\AccessAwareController: + tags: ['controller.service_arguments']