I'm trying to find a good way for handling my access controls in Symfony2.
My requirements:
- 90% of my application can only be accessed by authenticated users
- in many controllers I need to check if the user is the owner
- there are also some differences for different user roles
What I've done already:
- installed JMSSecurityExtraBundle to check permissions via annotation
- defined global ace's for my entity classes
- I create an ace for the owner for every object during the create process
The check for owner and roles is no Problem. I only want to define in a global way that a user has to be authenticated and for exceptions (sites that can be accessed anonymous) I want to define it separated (best via annotations). I don't want to do this via routing pattern.