codeIgniter认证+用户权限 [英] CodeIgniter authentication + user privileges

查看:129
本文介绍了codeIgniter认证+用户权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用建立一个认证系统,但我有决定这是我能acomplish的最佳方式是什么我想在codeIgniter一些问题。

I'm trying to build an authentication system in my application, but I'm having some problems in deciding which is the best way I could acomplish what I want in CodeIgniter.

该网站允许公司管理大厦。一个公司可以有很多的建筑,许多用户(当我说我的意思是从该公司员工的用户)。

The website allows companies to manage their buildings. A company can have many buildings, and many users (when I say users I mean employees from that company).

在这个网站,我想两者具有(基本上)四种一般类型的用户。

In this website I would like two have (basically) four general kind of users.


  • 超级管理员:这将能够新的管理员和新公司添加到数据库中,并赋予权限的管理员其余

  • 管理员:这将能够根据所分配的权限做不同的东西

  • 公司超级用户:直接当管理员创建一个新的公司该用户将被创建。该用户将能够为该公司建立的新用户,因为他/她就会共有权限,他将能够做的一切,其他用户的操作。

  • 公司用户:根据其超级用户分配的特权,该用户将能够做的,看到不同的数据(例如,一个简单的用户将只能够看到来自许多公司的建筑之一的信息)。

所以,尽管我见过很多认证库在那里为codeIgniter,这将是很好听到我怎么能设计出这种基于角色的身份验证制度的建议,如果你特别推荐的库这将有助于实现这一目标。

So, even though I've seen many authentication libraries out there for CodeIgniter, it would be nice to hear any recommendations about how I could design this "authentication role based" system, and if you particularly recommend a library that could help to accomplish this.

鸭preciate!

推荐答案

有已经处理codeigniter内认证许多图书馆,但一我会建议是的 Ion_Auth 。它可以处理用户权限(组)非常好,其实我已经做了<一个href=\"https://web.archive.org/web/20130811102028/http://jondavidjohn.com/blog/2011/01/scalable-login-system-for-$c$cigniter-ion_auth\">detailed再去编写自己概述一个很好的方式来处理与Ion_Auth这种情况。

There Are many libraries that already handle Authentication within Codeigniter, but the one I would recommend is Ion_Auth. It handles user permissions (groups) very well and I've actually done a detailed writeup outlining a good way to handle this situation with Ion_Auth.

这篇关于codeIgniter认证+用户权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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