Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Multiple groups for an user with SimpleAuth
  • Hi there.

    I didn't find out the answer on the doc, so here i am.

    Does the SimpleAuth package allow users to belong to mutiple group ? I guess it's possible because the SimpleAuth Auth::get_groups return an array and the doc say about it : "The get_groups method returns the user groupS assigned to the currently logged-in user"

    But how to set multiples groups to an user (I mean, the sql group field from the users table is a simple INT ? ) ? Thanks a lot.
  • HarroHarro
    Accepted Answer
    No. Both Simpleauth and Ormauth only support a single group.

    But are designed to use roles to assign permissions. In case of Simpleauth, thats it, in case of Ormauth you can also assign permissions to a user directly, or to a group.

    This looks like an error in the docs, get_groups() returns an array with two values, the group driver ID and the users group ID (singular).
  • Well thanks Harro, so to speak by metaphor, if i have a group "Duck" and a group "Hunter", and i want a duck to be able to hunt others ducks, i have to create a "Hunter-Duck" group and manually re-attributes rights and action ? Or there is another way ?
  • HarroHarro
    Accepted Answer
    To be a Hunter is a role, not a group.

    Groups are arbitairy collections of accounts, such as users, guests, etc. A role is a function you perform (within the context of the application) for which you as a use get assigned the permission associated with a role. A user can have an unlimited number of roles.

    In Simpleauth you can not assign permissions to groups, only roles (hence the name, "simple"), so it can only uses for simple purposes, like distinguish guests from users...

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion