How to add and manage ROLES in FOSUserBundle?

I installed FOSUserBundle and I would like to add any additional role like ROLE_NEW. In sfGuardUser just needed to be done

$this->getUser()->addCredential('new'); 

in action, and here?

In addition, how can I (the administrator) manage all users (primarily manage ROLES)? In sfGuardUser, I created a default admin page and here?

+6
source share
1 answer

By default, FOSUserBundle manages roles as an array, but you can use the "Groups" concept for this purpose.

Reading in docs https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/doc/groups.md

And read a few discussions about the advantages and disadvantages of FOS bundle - How to choose users with a specific role?

+7
source

Source: https://habr.com/ru/post/915188/


All Articles