From 200cd05a129028b996fcc9c0ececa5d36be300e6 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 7 Apr 2011 16:10:09 +0200 Subject: ACL resettet --- library/Pbs/Acl.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'library') diff --git a/library/Pbs/Acl.php b/library/Pbs/Acl.php index 4b1c826..214845f 100644 --- a/library/Pbs/Acl.php +++ b/library/Pbs/Acl.php @@ -6,16 +6,14 @@ class Pbs_Acl public static function checkRight($rightShortcut) { $userIDsNamespace = Zend_Session::namespaceGet('userIDs'); $roleID = $userIDsNamespace['roleID']; - - $rightMapper = new Application_Model_RightMapper(); - $element = $rightMapper->findBy(array('shortcut',$rightshortcut)); - if($element == null) - return false; - $rightRolesMapper = new Application_Model_RightRolesMapper(); - $rightroles = $rightRolesMapper->findBy(array('roleID' => $roleID,'rightID',$element->getID())); - if(count($rightroles) >=1){ - return true; + $rightroles = $rightRolesMapper->findBy(array('roleID' => $roleID),true); + $rightMapper = new Application_Model_RightMapper(); + foreach($rightroles as $rightrole) { + $right = $rightMapper->find($rightrole['rightID']); + if($right->getShortcut() == $rightShortcut) { + return true; + } } return false; } -- cgit v1.2.3-55-g7522