本文共 6370 字,大约阅读时间需要 21 分钟。
因为项目需要想在网上找点phpGACL的资料,可是在网上遍寻不着,于是只要靠自己很烂的E文水平去看E文原版资料了。看得郁闷之处,不觉开始埋怨 起来,想我堂堂中华居然就没有一E文功底深厚牛人给翻译一下,害得我这么费眼费神地去半蒙半猜地看E文。可能是抱怨的次数过多,朋友忍不住开始说我了,大 概是说我只知道拿E文差做借口,然后就心安理得地边抱怨边享受人家的劳动成果还说慢,做人要厚道之类的话。不过仔细想来也有道理,身为开源社区的一分子, 不能只知索取,不知奉献。E文烂不是也大致看懂了文档吗?难道就不可以翻一下,翻得不好自有高人指点,指点之后不就翻好了吗?怕翻错就把原文也放上来,这 样就算错了,也不至于误导得太厉害,毕竟搞计算机的或多或少还是懂点E文的。于是翻然醒悟,于是就有了这篇phpGACL中文手册。照例在前面加上译者水 平有限,请大家不吝斧正(人家那是谦虚,我这可是事实。汗颜呀!!*^-^*)
phpGACL
Generic Access Control Lists with PHP
基于PHP的通用访问控制列表
What is it?
它是什么?
phpGACL is an set of functions that allows you to apply access control to arbitrary objects (web pages, databases, etc) by other arbitrary objects (users, remote hosts, etc).
phpGACL是一组允许你控制对象(用户,远程主机等)访问其他对象(网页,数据库等)权限的函数。
It offers fine-grained access control with simple management, and is very fast.
该组函数可以通过简单的管理提供高精度的访问控制,并且运行地很快。
It is written in PHP (hence phpGACL), a popular scripting language that is commonly used to dynamically create web pages. The GACL part of phpGACL stands for Generic Access Control List.
它是用PHP,一种当前十分流行的通常被用来创建动态网页的脚本语言,编写的(因此被叫做 phpGACL)。phpGACL中的GACL代表Generic Access Control List,即通用访问控制列表。
phpGACL is hosted by sourceforge.net at http://phpGACL.sourceforge.net/
phpGACL的主机设在sourceforge.net上,可以通过网址是http://phpGACL.sourceforge.net/得到它。
The best way to explain access control is to use examples with real things rather than trying to relate to concepts.
试着解释访 问控制概念的最好方法就是举个实例,这比纯粹进行概念阐述要好得多。
Let's assume from now on that access is Boolean. That is, the result of looking up a person's access to a room is either ALLOW or DENY. There is no middle ground.
让我们假设 从现在开始访问权限都是用布尔值来表示的。也就是说,人们进入房间的权限要么是允许,要么是拒绝,而没有其他中间的值。
Who/Where | Cockpit | Lounge | Guns | Engines |
Han | O | O | O | O |
Chewie | O | O | O | X |
Obi-wan | X | O | X | X |
Luke | X | O | X | X |
R2-D2 | X | O | X | X |
C3PO | X | O | X | X |
Managing access using an access matrix like the one above has advantages and disadvantages.
使用权限表 来管理权限有其优点也有其缺点。
Who/Where | Cockpit | Lounge | Guns | Engines |
Han | O | O | O | O |
Chewie | O | X | O | X |
Obi-wan | X | O | X | X |
Luke | O | O | O | X |
R2-D2 | X | O | X | O |
C3PO | O | O | X | O |
This matrix is not so obvious to summarize, and it's not clear to the reader why those access decisions might have been made in the first place.
上表就不能 清楚的总结了,而且它也不能很清楚地让人明白首先为什么要这样设定那些权限。
转载地址:http://dnhnl.baihongyu.com/