Y
Y
Yuri Matveenko2018-05-06 23:59:27
symfony
Yuri Matveenko, 2018-05-06 23:59:27

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());

As I understand it, the roles are drawn from the session.
How can I change roles without re-authorization?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question