PREMISE: All users on the system need to have accepted an NDA and SLA and filled in a questionnaire.
CONDITIONS:
1) The entire system (from /) falls under the security firewall in order to determine whether a user is logged in or not.
2) Routes under ^/ is authenticated anonymously.
3) Routes under ^/portal/ required ROLE_USER.
IMPLEMENTATION: I would like to implement a custom checker on all routes under ^/portal/ (including /portal/, /portal/orders/, /portal/admin/, /portal/admin/orders/, etc) to check whether the user has accepted the NDA, and if not not redirect to a page where the user can accept the NDA, then check for SLA and then for the questionnaire.
QUESTION: Is there a way to implement this in Symfony2 so that a "Check" function gets called first and then continues on to the actual controller function for which the route is set up, other than manually calling the check function in every controller function for every route?
COMPLICATION: The NDA/SLA/QUESTIONNAIRE pages to which the user will be redirected, will need to fall under ^/portal/, so these must also be excluded from the check (either inside the check function or in some other manner) in order to avoid a continuous redirect.