English 中文(简体)
公共卫生和社会福利部
原标题:Access Control and RBAC (Roles Based Access Control) In PHP Hybrid (procedural and OOO) application
  • 时间:2011-11-23 15:46:09
  •  标签:
  • php

我有这种PHP(procedural and OOP)应用,即希望设立一个RBAC。

I can create the database tables (permissions, roles, users etc.), I can also find a lot of articles about the subject online but they all seem to be missing the most important part : "The resource" that we want to protect.

Zend_ACL似乎是ok,但我的申请不是MVC框架。

Question 1 I am wondering if the zend_acl is loosely coupled enough to use even though my entire application is not object based.

Question 2 How do i define the resources when the entire application is not object-based?

Question 3 Is there any good non-obsolete whitepaper out there that could allow me to create a role based system when dealing with an heterogeneous (procedural and OOP) system?

再次

问题回答

“资源”只是一个非常笼统和抽象的东西,实际上它可能是任何东西。 在结构完善的MVC结构中,这一资源通常与类别/方法相对应,后者与URLs相对应。 这等于是任意的。 即使在纯粹的程序性项目中,你也可以任意界定资源:

$resource =  root.foo.bar ;
$user     = getCurrentUser();

if (!isAllowedToAccess($user, $resource)) {
    exit;
}

// do something that represents root.foo.bar

保持贵国法典的哪一条轨道,意味着在没有良好的业务协调办公室结构,但绝不是不可能就哪一种资源采取行动。 如果文字组织良好,你就只能用文字档案。

我可以具体谈谈<代码>Zend_ACL,但我感到惊讶的是,如果它难以与业务处的概念相连接。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签