Answer the question
In order to leave comments, you need to log in
How to change the role without re-authorization?
There are three roles.
ROLE_USER for all users
Two more roles restrict access to some pages.
For example ROLE_RED and ROLE_BLUE
The user can have the roles ROLE_USER&ROLE_RED or ROLE_USER&ROLE_BLUE
The role can be changed (it can be seen in the database), but the pages, after changing the role, are still available from the old role and still inaccessible to the new one.
After logout and login everything works fine.
FOSUserBundle had this feature:
$this->get('fos_user.user_manager')->refreshUser($this->getUser());
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question