From ac66a885a686bf5bf147aa6cb3c1261d0e130dac Mon Sep 17 00:00:00 2001 From: Christian Gahlert Date: Mon, 17 Sep 2012 18:46:50 +0200 Subject: [PATCH 1/4] Modified Zend Acl/Navigation to be extendable. --- src/Acl.php | 2 +- src/AclInterface.php | 58 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/AclInterface.php diff --git a/src/Acl.php b/src/Acl.php index 30eab0c..eb287e5 100644 --- a/src/Acl.php +++ b/src/Acl.php @@ -15,7 +15,7 @@ * @package Zend_Permissions * @subpackage Acl */ -class Acl +class Acl implements AclInterface { /** * Rule type: allow diff --git a/src/AclInterface.php b/src/AclInterface.php new file mode 100644 index 0000000..9d61e68 --- /dev/null +++ b/src/AclInterface.php @@ -0,0 +1,58 @@ +allow()). + * + * If a $privilege is not provided, then this method returns false if and only if the + * Role is denied access to at least one privilege upon the Resource. In other words, this + * method returns true if and only if the Role is allowed all privileges on the Resource. + * + * This method checks Role inheritance using a depth-first traversal of the Role registry. + * The highest priority parent (i.e., the parent most recently added) is checked first, + * and its respective parents are checked similarly before the lower-priority parents of + * the Role are checked. + * + * @param Role\RoleInterface|string $role + * @param Resource\ResourceInterface|string $resource + * @param string $privilege + * @return boolean + */ + public function isAllowed($role = null, $resource = null, $privilege = null); + +} \ No newline at end of file From 32b43d1cbd5014e9656e18917824245824a500ac Mon Sep 17 00:00:00 2001 From: Christian Gahlert Date: Mon, 17 Sep 2012 19:38:08 +0200 Subject: [PATCH 2/4] Fixed spaces/braces. --- src/AclInterface.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AclInterface.php b/src/AclInterface.php index 9d61e68..d738ffe 100644 --- a/src/AclInterface.php +++ b/src/AclInterface.php @@ -1,4 +1,5 @@ Date: Mon, 17 Sep 2012 19:42:26 +0200 Subject: [PATCH 3/4] And removed another additional line feed... :( --- src/AclInterface.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/AclInterface.php b/src/AclInterface.php index d738ffe..b390aac 100644 --- a/src/AclInterface.php +++ b/src/AclInterface.php @@ -1,5 +1,4 @@ Date: Mon, 17 Sep 2012 20:01:33 +0200 Subject: [PATCH 4/4] Changed CRLF linefeeds to LF. Stupid netbeans! --- src/AclInterface.php | 112 +++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/src/AclInterface.php b/src/AclInterface.php index b390aac..93beb4b 100644 --- a/src/AclInterface.php +++ b/src/AclInterface.php @@ -1,57 +1,57 @@ -allow()). - * - * If a $privilege is not provided, then this method returns false if and only if the - * Role is denied access to at least one privilege upon the Resource. In other words, this - * method returns true if and only if the Role is allowed all privileges on the Resource. - * - * This method checks Role inheritance using a depth-first traversal of the Role registry. - * The highest priority parent (i.e., the parent most recently added) is checked first, - * and its respective parents are checked similarly before the lower-priority parents of - * the Role are checked. - * - * @param Role\RoleInterface|string $role - * @param Resource\ResourceInterface|string $resource - * @param string $privilege - * @return boolean - */ - public function isAllowed($role = null, $resource = null, $privilege = null); +allow()). + * + * If a $privilege is not provided, then this method returns false if and only if the + * Role is denied access to at least one privilege upon the Resource. In other words, this + * method returns true if and only if the Role is allowed all privileges on the Resource. + * + * This method checks Role inheritance using a depth-first traversal of the Role registry. + * The highest priority parent (i.e., the parent most recently added) is checked first, + * and its respective parents are checked similarly before the lower-priority parents of + * the Role are checked. + * + * @param Role\RoleInterface|string $role + * @param Resource\ResourceInterface|string $resource + * @param string $privilege + * @return boolean + */ + public function isAllowed($role = null, $resource = null, $privilege = null); } \ No newline at end of file