From 6ec7b71fc77d394a87456a7b81e531b1e381ab98 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Thu, 7 Apr 2011 16:29:51 +0200 Subject: ACL gefixt --- library/Pbs/Acl.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'library') diff --git a/library/Pbs/Acl.php b/library/Pbs/Acl.php index 4b1c826..ac4c8aa 100644 --- a/library/Pbs/Acl.php +++ b/library/Pbs/Acl.php @@ -4,20 +4,23 @@ 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)); + $element = $rightMapper->findBy(array('shortcut' => $rightShortcut),true); + if($element == null) return false; - + $rightRolesMapper = new Application_Model_RightRolesMapper(); - $rightroles = $rightRolesMapper->findBy(array('roleID' => $roleID,'rightID',$element->getID())); - if(count($rightroles) >=1){ + $rightroles = $rightRolesMapper->findBy(array('roleID' => $roleID, 'rightID' => $element[0]['rightID']),true); + + if($rightroles != null) return true; - } + return false; + } public static function checkRightByMembershipID($membershipID, $rightShortcut) { -- cgit v1.2.3-55-g7522