English 中文(简体)
Zend_Acl,其作用和许可储存在数据库中
原标题:Zend_Acl, with roles and permissions stored in database

i 想要为我的申请建立一个有以下要求的《欧洲空间法》系统。

  1. Users will be assigned single or multiple role. (Admin, Staff) etc.
  2. Role will have permissions.(Send_Invoices, Send_mail, Delete_Invoices, Send_Estimate) etc.
  3. User will be assigned custom permission apart from the role it inherits.

我的数据库结构如下:

role:
+----------+-------------+------+-----+---------+----------------+
| Field    | Type        | Null | Key | Default | Extra          |
+----------+-------------+------+-----+---------+----------------+
| id       | int(11)     | NO   | PRI | NULL    | auto_increment |
| roleName | varchar(50) | NO   | UNI | NULL    |                |
+----------+-------------+------+-----+---------+----------------+
permission:
+----------------+-------------+------+-----+---------+----------------+
| Field          | Type        | Null | Key | Default | Extra          |
+----------------+-------------+------+-----+---------+----------------+
| id             | int(11)     | NO   | PRI | NULL    | auto_increment |
| permissionName | varchar(50) | NO   |     | NULL    |                |
| permissionKey  | varchar(50) | NO   | UNI | NULL    |                |
+----------------+-------------+------+-----+---------+----------------+
role_permission
+---------------+---------+------+-----+---------+----------------+
| Field         | Type    | Null | Key | Default | Extra          |
+---------------+---------+------+-----+---------+----------------+
| id            | int(11) | NO   | PRI | NULL    | auto_increment |
| role_id       | int(11) | NO   | MUL | NULL    |                |
| permission_id | int(11) | NO   |     | NULL    |                |
+---------------+---------+------+-----+---------+----------------+
user_role
+---------------+---------+------+-----+---------+----------------+
| Field         | Type    | Null | Key | Default | Extra          |
+---------------+---------+------+-----+---------+----------------+
| id            | int(11) | NO   | PRI | NULL    | auto_increment |
| user_id       | int(11) | NO   | MUL | NULL    |                |
| role_id       | int(11) | NO   |     | NULL    |                |
+---------------+---------+------+-----+---------+----------------+
user_permission
+---------------+---------+------+-----+---------+----------------+
| Field         | Type    | Null | Key | Default | Extra          |
+---------------+---------+------+-----+---------+----------------+
| id            | int(11) | NO   | PRI | NULL    | auto_increment |
| user_id       | int(11) | NO   | MUL | NULL    |                |
| permission_id | int(11) | NO   |     | NULL    |                |
+---------------+---------+------+-----+---------+----------------+

i) 移至Zend Framework,在决定Zentd_Acl时存在问题,使我得以实施目前的结构。 我的问题是。

  1. is it possible for me to implement the ACL with current database structure to do the needful in Zend Framework?
  2. is there any better implementation that could allow me to achieve what i want in zend framework?

i 如果有人能向我提供一种办法,开始做我需要做的事情,将不胜感激。 能够帮助我的任何资源、联系?

谢谢。

最佳回答

Well I think this structure is really good , to get this working you had to do 2 steps

1-所有数据库和所需资源

2- 创建ACL方案,确定用户的作用及其许可

一些理论支持的例子:

www.un.org/ga

.Developing a Doctrine-support ACL helper TDD- model, part 2

另一项简单文件:

具有活力的ACL在冻结的框架内吗?

问题回答

为什么不在数据库中使用赠款/名册系统?





相关问题
Zend 邮件问题,涉及外国char子+ com子

泽斯德邮局在名称被定为具有外国性质(如“保”)和 com(”)的物品时,就放弃了一种例外(因为邮局(邮局)退回假)。 重新提出以下守则。

PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

Link to a specific step in onepage checkout

Is it possible to redirect the browser to nth step in the onepage checkout? If so, how would one go about doing it? I m working on a payment module and have a sort of "cancel" action that i would ...

Tagging with Zend Framework

I m trying to create the same solutions as below, but using a simple MySQL query (instead of the static version used below where the words/tags are implemented in the code). The name of the MySQL ...

dynamicaly adding textboxes to zend_form

I hope that this is a quick question to answer. I am developing a form using Zend_Form, I have a number of Zend_Dojo_Form_Element_Textboxs to add to this form dynamically. These are added from rows ...

热门标签