summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorSimon2011-04-07 16:10:09 +0200
committerSimon2011-04-07 16:10:09 +0200
commit200cd05a129028b996fcc9c0ececa5d36be300e6 (patch)
treef1f7e433d652e3a93151be84756daadbc59c5f68 /library
parentACL-Cache geht bei statischen klassen nicht - ups (diff)
downloadpbs2-200cd05a129028b996fcc9c0ececa5d36be300e6.tar.gz
pbs2-200cd05a129028b996fcc9c0ececa5d36be300e6.tar.xz
pbs2-200cd05a129028b996fcc9c0ececa5d36be300e6.zip
ACL resettet
Diffstat (limited to 'library')
-rw-r--r--library/Pbs/Acl.php16
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;
}