0

now, i'm trying to work out a admin back office in my Symfony projet.

Probably before use SonataBundle, I would like to know what is "group_class" in app/config/config.yml what is the use ?

# FOSUserBundle Configuration
fos_user:
    db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
    firewall_name: main
    user_class: BISSAP\UserBundle\Entity\User
    group:
        group_class: BISSAP\UserBundle\Entity\GroupRole
    registration:
        form:
            type: app_user_registration
Bissap
  • 521
  • 1
  • 5
  • 23

2 Answers2

1

Groups are a way to associate a list of roles to all users of the group. This is a concept inherited from the symfony1 sfGuardPlugin, at a time where there was no role hierarchy in Symfony 2 (way before the stable release).

Note that as the maintainer of FOSUserBundle, my advice is to avoid using them. In most cases, the role hierarchy is enough to achieve the need, making groups more complex for no benefit. And for the few other cases, I found that using voters related to actual business logic of the project is more maintainable than using FOSUserBundle groups (I think I haven't used them in any project since 4 years).

0

Group class is like group of users in Linux OS,it allows you to associate groups to your users.

Groups are a way to group a collection of roles. The roles of a group will be granted to all users belonging to it.

Anas EL KORCHI
  • 2,008
  • 18
  • 25
  • ok;but i know the intersest and running of Group class, i would like to know how can i configure the groups into config.yml and security.yml. I don't find the procedure to manage groups with roles (ROLE_USER, ROLE_ADMIN...) are nothing into symfony doc? – Bissap Dec 21 '15 at 22:01