如何在ion auth codeigniter中创建子组? [英] How to create sub groups in ion auth codeigniter?

查看:75
本文介绍了如何在ion auth codeigniter中创建子组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我们可以在ion auth中创建组.但是我需要在成员和职员组内部有子组.我的项目需要以下用户角色.

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. 管理员
  2. 会员
    • 计划A成员
    • 计划B成员
    • 计划C成员
  1. Admin
  2. Members
    • plan A members
    • plan B members
    • plan C members
  • 技术人员
  • 管理人员
  • 总参谋部

根据成员选择的计划,视图"和功能将发生变化.

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

我当时正在考虑向用户表添加一个新列以指定所使用的计划. 另一种选择是创建3个没有父成员组的计划组. 还有其他使用ion auth添加子组的方法吗?

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?

推荐答案

@Arunu-使它们成为每个组而不是子组的想法是最好的方法.

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

没有真正的理由要有一个权限层次结构(我认为您可能会在ACL中混用身份验证,这很容易做到).

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的设置是为了使一个用户可以有多个组-例如,您的所有用户都可以拥有一个Member记录,然后为每个子组创建一个单独的记录.

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

这篇关于如何在ion auth codeigniter中创建子组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆