在php中实现不同的用户级别视图 [英] Implement different user level views in php
问题描述
可能重复:
在PHP和Javascript中实施用户授权
Possible Duplicate:
Implementing User Authorization in PHP and Javascript
我有一个基本的会计系统,具有以下用户和用户级别,
I have a basic accounting system with the following users and user levels,
(用户名,密码,用户级别)
A ,123, Admin
B ,456,会计师
C ,789,工作人员成员
D ,999,经理
我需要根据他们的用户级别为他们提供不同的选择信息.例如
I need to provide them with different selected information based on their user level. For example,
-管理员具有创建和删除用户帐户的权限
-only admins have privileges of creation and deletion of user accounts
-工作人员仅具有查看销售和购买信息的权限
-staff only has privileges to view sales and purchasing information
-仅会计师具有记录会计分录的特权
-only accountants have privileges to record accounting entries
-经理和会计师具有查看管理报告的权限
-only managers and accountants have privileges to view management reports
如何使用PHP(OOP)实现此功能?
How can i implement this using PHP(OOP)?
谢谢.
推荐答案
已经有许多RBAC(基于角色的访问控制)实现.我建议使用其中一种而不是创建自己的:
There are many RBAC (role based access control) implementation already. I suggest using one of those rather than creating your own:
- http://phpmaster.com/role-based-access- control-in-php/
- http://www.tonymarston.net/php -mysql/role-based-access-control.html
- 基于角色的访问控制
- http://phpmaster.com/role-based-access-control-in-php/
- http://www.tonymarston.net/php-mysql/role-based-access-control.html
- Role Based Access Control
这篇关于在php中实现不同的用户级别视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!