codeigniter ion_auth admin groups

Hi
is it possible to have more than one group as admin_group? being able to change users?
or, in alternative, how can i add one user to more than one group?

Thanks

Upvotes: -1

Views: 1069

Answers (1)

jondavidjohn
jondavidjohn

Reputation: 62392

The "admin" group is just another named group. There is nothing special about it other than it has a shortcut to check that role with...

$this->ion_auth->is_admin();

instead of just using...

$this->ion_auth->is_group('admin_group');

so really it all depends on how YOU treat the users.

so, to allow 2 groups admin access I'd just do this... Note is_group() can accept an array of strings also.

$admin_groups = array('admin_group1','admin_group2');

if ($this->ion_auth->is_group($admin_groups)) {
    //do stuff
}

Upvotes: 3

Related Questions