When I secure a certain area of my Symfony2 project by the firewall, people are being redirected to the login page. How can I display a dynamic message on that login page, that tells the user about the required user role?
E.g. there are four different pages on my project
/
is not restricted,/admin
requiresROLE_ADMIN
,/user
requiresROLE_USER
,/beta
requiresROLE_BETA_USER
.
If the user tries to access /beta
, above the login page there shall be the information
This area is restricted to beta users.
... and accordingly for /admin
and /user
. Is there a way to set this message globally (without having to set it on each controller action separately)?