security - symfony 2 add roles in an event listener before firewall check -


i have application user can belong many companies. user access company portal via compnaysubdomain.example.com). when user access compnay portal have update roles have company (by checking subdomain , database). created request event listener that, parses subdomain, queries database , adds new roles user. problem need able to access security context can update user roles, listener priority has less firewall priority. but, if firewall listener executed first, checks user roles immediatly not updated yet based on company.

any suggestions?. may need implement custom firewall listener or that. dont want overcomplicate.

thank you.

ok. have decided create firewall listener achieve this. followed tutorial http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html created firewall listener. token , provider using 1 using.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -