Module: nagvis
Branch: master
Commit: b791d0970e7a2f50429cea0f90a4ce1845c33639
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=b791d0970e7a2f50429cea0f90a4ce1845c33639

Author: LaMi <[email protected]>
Date:   Thu Apr  1 14:31:54 2010 +0200

#238 Fixed implicit permission update

---

 .../core/classes/CoreAuthorisationHandler.php      |   23 ++++++++++---------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/share/server/core/classes/CoreAuthorisationHandler.php 
b/share/server/core/classes/CoreAuthorisationHandler.php
index 2c1d268..e2b2fde 100644
--- a/share/server/core/classes/CoreAuthorisationHandler.php
+++ b/share/server/core/classes/CoreAuthorisationHandler.php
@@ -193,14 +193,14 @@ class CoreAuthorisationHandler {
        public function updateRolePerms($roleId, $perms) {
                // FIXME: First check if this is supported
                
-               // Get all permissions
+               // Get current permissions
                $aPerms = $this->MOD->getAllPerms();
                
                // Resolve summarized perms
                foreach($perms AS $key => $value) {
                        $aPerm = Array();
                        
-                       // Get matching permission
+                       // Get current permissions for that access level
                        foreach($aPerms AS $perm) {
                                if($perm['permId'] == $key) {
                                        $aPerm = $perm;
@@ -210,6 +210,7 @@ class CoreAuthorisationHandler {
                        
                        $mod = $aPerm['mod'];
                        $act = $aPerm['act'];
+                       $obj = $aPerm['obj'];
                        
                        // Check if this mod+act summarizes something
                        if(isset($this->summarizePerms[$mod])) {
@@ -217,12 +218,13 @@ class CoreAuthorisationHandler {
                                        if($summarizingAct === $act) {
                                                // Get the id of the summaried 
action
                                                foreach($aPerms AS $perm) {
-                                                       if($mod == $perm['mod'] 
&& $summarizedAct == $perm['act']) {
+                                                       if($mod == $perm['mod']
+                                                          && $summarizedAct == 
$perm['act']
+                                                          && $obj == 
$perm['obj']) {
                                                                
$summarizedActId = $perm['permId'];
                                                                break;
                                                        }
                                                }
-                       
                                                // Add the summarized action to 
the permissions array
                                                $perms[$summarizedActId] = 
$value;
                                        }
@@ -268,21 +270,21 @@ class CoreAuthorisationHandler {
                                        } 
elseif(isset($this->aPermissions[$modAccess][$actAccess][AUTH_PERMISSION_WILDCARD]))
 {
                                                $bAutorized = true;
                                        } else {
-                                               // FIXME: Logging
-                                               //echo 'object denied';
+                                               if(DEBUG&&DEBUGLEVEL&2)
+                                                       debug('Object access 
denied (Mod: '.$sModule.' Act: '.$sAction.' Object: '.$sObj);
                                                $bAutorized = false;
                                        }
                                } else {
                                        $bAutorized = true;
                                }
                        } else {
-                               // FIXME: Logging
-                               //echo 'action denied';
+                               if(DEBUG&&DEBUGLEVEL&2)
+                                       debug('Action access denied (Mod: 
'.$sModule.' Act: '.$sAction.' Object: '.$sObj);
                                $bAutorized = false;
                        }
                } else {
-                       // FIXME: Logging
-                       //echo 'module denied';
+                       if(DEBUG&&DEBUGLEVEL&2)
+                               debug('Module access denied (Mod: '.$sModule.' 
Act: '.$sAction.' Object: '.$sObj);
                        $bAutorized = false;
                }
                
@@ -290,7 +292,6 @@ class CoreAuthorisationHandler {
                if($bAutorized === true) {
                        return true;
                } else {
-                       // FIXME: Logging
                        return false;
                }
        }


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to