How to create sub groups in ion auth codeigniter?

邮差的信 提交于 2019-12-11 03:19:43

问题


I know we can create groups in ion auth. But I need sub group inside members and staff groups.The following user roles are required for my project.

  1. Admin
  2. Members
    • plan A members
    • plan B members
    • plan C members
  3. Staff
    • technical staff
    • management staff
    • general staff

Based on plan selected by member, the 'views' and functionalities will change.

I was thinking of adding a new column to users table to specify the plan used. Another option is to create 3 plan groups without parent member group. Is there any other way to add sub groups using ion auth?


回答1:


@Arunu - your idea to make them each groups, not subgroups, is the best way to go.

There is no real reason to have a hierarchy of permissions (I think you may be mixing authentication with ACL a bit, a very easy thing to do).

Ion_auth is set up so that a user can have multiple groups - so, for example, all your users could have a Members record, and then a separate record for each sub group.

Each controller entry point simply says what groups are allowed in or not - it treats them all the same.

also, you can dynamically display data based on what groups the user belongs to



来源:https://stackoverflow.com/questions/14953219/how-to-create-sub-groups-in-ion-auth-codeigniter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!