Skip to content

Commit

Permalink
Merge pull request #1 from bolt/feature/auto-include-services-and-routes
Browse files Browse the repository at this point in the history
Automatically include needed services and routes
  • Loading branch information
I-Valchev authored Jul 25, 2020
2 parents cb780d9 + e0ee58b commit d9182b0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
27 changes: 1 addition & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions config/routes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
users_extension_controllers:
resource: '../vendor/bolt/users/src/'
type: annotation
13 changes: 13 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -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']

0 comments on commit d9182b0

Please sign in to comment.