[icinga-checkins] icinga.org: icinga-web/master: Disabling all caching of permissions for a user (refs #3880)

git at icinga.org git at icinga.org
Thu Apr 4 11:52:52 CEST 2013


Module: icinga-web
Branch: master
Commit: 5f3bde7ce1afc07d0d373d4114606566ee50d731
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=5f3bde7ce1afc07d0d373d4114606566ee50d731

Author: Markus Frosch <markus at lazyfrosch.de>
Date:   Mon Mar 25 15:53:49 2013 +0100

Disabling all caching of permissions for a user (refs #3880)

When deleting a user from the system all permissions of the logged
in user got deleted - including the permissions from his groups.

---

 app/modules/AppKit/lib/database/models/NsmUser.php |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/app/modules/AppKit/lib/database/models/NsmUser.php b/app/modules/AppKit/lib/database/models/NsmUser.php
index a6891bb..f44ee57 100755
--- a/app/modules/AppKit/lib/database/models/NsmUser.php
+++ b/app/modules/AppKit/lib/database/models/NsmUser.php
@@ -435,8 +435,10 @@ class NsmUser extends BaseNsmUser {
      * @return Doctrine_Collection
      */
     public function getPrincipals($userOnly= false) {
+        /* removed caching for principals due to problems on deletion -mfrosch
         if ($this->principals === null)
             $this->principals =  $this->getStorage()->read("appkit.nsm_user.principals");
+        */
 
         if ($this->principals === null) {
             $roles = $this->getRoleIds();
@@ -447,7 +449,9 @@ class NsmUser extends BaseNsmUser {
 
                                 ->orWhere('p.principal_user_id = ?',$this->user_id)
                                 ->execute();
+            /* removed caching for principals due to problems on deletion -mfrosch
             $this->getStorage()->write("appkit.nsm_user.principals",$this->principals);
+            */
         }
         
         return $this->principals;
@@ -575,10 +579,12 @@ class NsmUser extends BaseNsmUser {
     }
 
     public function getTargetValuesArray() {
+        /* removed caching for target values due to problems on deletion -mfrosch
         if (empty(self::$targetValuesCache)) {
             self::$targetValuesCache = $this->getStorage()->read("appkit.nsm_user.targetvalues");
         }
         if (empty(self::$targetValuesCache)) {
+        */
             $tc = AppKitDoctrineUtil::createQuery()
                   ->select('t.target_name, t.target_id')
                   ->from('NsmTarget t')
@@ -608,9 +614,12 @@ class NsmUser extends BaseNsmUser {
                 }
             }
             
+        /* removed caching for target values due to problems on deletion -mfrosch
             self::$targetValuesCache =& $out;
             $this->getStorage()->write("appkit.nsm_user.targetvalues",self::$targetValuesCache);
         }
         return self::$targetValuesCache;
+        */
+        return $out;
     }
 }





More information about the icinga-checkins mailing list