建立基于角色的应用程序
我必须做一个小型网站
我有7种类型的用户.可以登录系统.
where I have 7 type of users. which can login into system.
一些用户有权添加设备,而其他用户则可以添加/编辑.其中一些只能查看.
some of users have permissions to only add equipments and others can add/edit. some of them can only view.
在系统中添加设备的所有用户都有一些公共字段,而某些字段是特定于用户的.
There will be some common fields for all users adding equipments in system and some fields will be user specific.
我必须随着用户更换设备来跟踪设备中的所有变化.
I have to track all changes in equipments with user changing equipments.
任何人都可以解释什么是完成这项工作的最佳方法.
Can any one explain what will be best way to do this job.
用户感知表结构的方式并跟踪设备的更改,用户跟踪登录以及用户所做的更改.
Way in the sense table structure for users and tracking changes in equipments and users tracking for both login and what changes done by them.
我正在使用php和mysql数据库.
Am using php and mysql database.
我不想去CMS,Frameworks.这是一个小应用程序.
I don't want to go for CMS,Frameworks. It's a small application.
It sounds like you are going to need a role-based access control system. Developing one is not really a trivial task, so as already suggested, finding a framework or ready-made class that does the job would be a worthwhile start.
但是,有很多关于如何创建一个的信息.这里有一些链接可以帮助您入门:
However, there's plenty of information out there on how to create one. Here's a few links to get you started:
堆栈溢出
基于角色的访问控制 对PHP页面的基于角色的访问 (无效链接)
Role Based Access ControlRole-based access to pages in PHP (dead link)
其他网站
基于角色的访问控制(RBAC)系统,用于PHP
基于精细角色的访问控制(RBAC)系统
模式教程系列(第1部分):RBAC域模型
A Role-Based Access Control (RBAC) system for PHP
Fine Grained Role Based Access Control (RBAC) system
Patterns Tutorial Series (part 1): RBAC Domain Model
搜索 PHP RBAC 无疑会发现更多的信息.
A search for PHP RBAC will no doubt reveal many more.