Tomek Buszewski
Tomek Buszewski

Reputation: 7935

Set user roles from phpmyadmin

It seems to be something very easy, and yet I am unable to find anything about it. So, I use FOSUserBundle for Symfony2. I registered my user and I want it to have ROLE_ADMIN. Since I don't plan to have more admins, I want to set it from phpmyadmin. Is this possible?

Upvotes: 1

Views: 3009

Answers (1)

Juan Sosa
Juan Sosa

Reputation: 5280

Yes, it is possible. You will need to add ROLE_ADMIN to your roles database field as a serialized array:

a:1:{i:0;s:10:"ROLE_ADMIN";}

However, that's not the recommended way to promote a user. Instead you can use the following console command:

php app/console fos:user:promote

Upvotes: 3

Related Questions