summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
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;
}