I have a admin panel and I have defined a role for it ROLE_ADMIN
. In my security.yml file I am using a pattern ^/admin/*
so every thing under /admin requires ROLE_ADMIN
. Now in frontend of my app I need to check user role and if role is ROLE_ADMIN
render one file and otherwise render another file. This url does not fall under the pattern defined in security.yml.
So how do I check whether the user is admin or a normal user on the homepage which does not fall under the pattern defined in security.yml ?