summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authormichael pereira2011-04-07 16:29:51 +0200
committermichael pereira2011-04-07 16:29:51 +0200
commit6ec7b71fc77d394a87456a7b81e531b1e381ab98 (patch)
tree3bb8961039a6644c67392719d11c23edf3deb500 /library
parentACL-Cache geht bei statischen klassen nicht - ups (diff)
downloadpbs2-6ec7b71fc77d394a87456a7b81e531b1e381ab98.tar.gz
pbs2-6ec7b71fc77d394a87456a7b81e531b1e381ab98.tar.xz
pbs2-6ec7b71fc77d394a87456a7b81e531b1e381ab98.zip
ACL gefixt
Diffstat (limited to 'library')
-rw-r--r--library/Pbs/Acl.php15
1 files changed, 9 insertions, 6 deletions
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) {