I'm working on a symfony application I'm heading for the finals.
Right now I'm working with the security issues, granting that nobody will see more than it needs.

I have a specific user that can only access a specific route, that I'have manage using Roles, however, I'll have lots of that users, and need to check if the current user is accessing its own data, and denies the access otherwise.

For example, I'll have many users with the same ROLE, lets say I'll have many ROLE\_EMPLOYER, each one will have its own access to the system but, they need to be able to access just its own show page and employees without being able to access other employer page. 

I researched the security authorization checker and saw that I can denie the access into the actions of the controlers, but I was willing if there is something simpler like that:

```
security.yml
   access_control:
   - { path: ^/fornecedor/{id},  allow_if: "{id} == token.getUser.getId and has_role('ROLE_FORNECEDOR')" }

```

Thank you