Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add and manage ROLES in FOSUserBundle?

I installed FOSUserBundle and i would like to add any additional role, such ROLE_NEW. In sfGuardUser just had to do

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

in action, and here?

Besides, how can I (admin) manage all (first of all manage ROLES) users? In sfGuardUser I had generated default admin page, and here?

like image 709
Tony Evyght Avatar asked May 08 '12 11:05

Tony Evyght


1 Answers

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

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

And read some discussions about advantages and disadvantages FOS bundle - How to select users with a specific role?

like image 95
smoreno Avatar answered Oct 18 '22 18:10

smoreno