Jarek Kowol
Jarek Kowol

Reputation: 607

FOSUserBundle proper solution for team consist with multiple users

I am using FOSUserBundle in my Symfony2 project.

My goal is to make the teams consist with multiple users. Users are invites by administrator (owner) by e-mail confirmation.

If a user belongs to one team, can't set up new accounts using the same address. Of course, each user should have the opportunity to unsubscribe from the team.

Are there any ready-made solutions? I looked for Groups With FOSUserBundle. Or do you have any good advice?

Upvotes: 2

Views: 80

Answers (1)

chalasr
chalasr

Reputation: 13167

You were right, groups can be a good ready-to-use solution to make your logic.
The association is already setup and it's also easy to extend.

The documentation (now part of Symfony's doc) contains a great guide to use groups.

Of course, you can make your own entity, take example from the FOSUB User->Group logic (association) .

You should see the Security and Roles part of the documentation to manage authorisations of your different kind of users.
You can assign roles to your different groups, and make your users directly inherit the roles of their group for manage access permissions.

For the confirmation email, see the corresponding documentation too .

And for the unsubscribing, just remove the association between the user you want remove from a Group and the Group (or Team). This is also part of the association, see the doctrine documentation.

Good use.

Upvotes: 3

Related Questions