diff options
| author | Simon | 2011-04-07 16:10:09 +0200 |
|---|---|---|
| committer | Simon | 2011-04-07 16:10:09 +0200 |
| commit | 200cd05a129028b996fcc9c0ececa5d36be300e6 (patch) | |
| tree | f1f7e433d652e3a93151be84756daadbc59c5f68 | |
| parent | ACL-Cache geht bei statischen klassen nicht - ups (diff) | |
| download | pbs2-200cd05a129028b996fcc9c0ececa5d36be300e6.tar.gz pbs2-200cd05a129028b996fcc9c0ececa5d36be300e6.tar.xz pbs2-200cd05a129028b996fcc9c0ececa5d36be300e6.zip | |
ACL resettet
| -rw-r--r-- | library/Pbs/Acl.php | 16 |
1 files changed, 7 insertions, 9 deletions
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; } |
