[icinga-checkins] icinga.org: icinga-web/feature/datapermissions-wip: Added role inheritance calls to other credential handlers

git at icinga.org git at icinga.org
Tue Feb 19 17:23:59 CET 2013


Module: icinga-web
Branch: feature/datapermissions-wip
Commit: 979ec528a7bf3d30fe45a770fb7a601e1028f194
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=979ec528a7bf3d30fe45a770fb7a601e1028f194

Author: Markus Frosch <markus at lazyfrosch.de>
Date:   Tue Feb 19 14:43:26 2013 +0100

Added role inheritance calls to other credential handlers

---

 .../Api/models/Views/ApiDQLViewModel.class.php     |    3 ++-
 .../Extender/CustomVariableExtenderModel.class.php |    4 ++--
 ...tificationCustomVariableExtenderModel.class.php |    6 +++---
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/app/modules/Api/models/Views/ApiDQLViewModel.class.php b/app/modules/Api/models/Views/ApiDQLViewModel.class.php
index dd13fab..5d7f986 100755
--- a/app/modules/Api/models/Views/ApiDQLViewModel.class.php
+++ b/app/modules/Api/models/Views/ApiDQLViewModel.class.php
@@ -218,6 +218,7 @@ class API_Views_ApiDQLViewModel extends IcingaBaseModel {
                     );
                     break;
                 case "dql":
+                    AppKitLogger::verbose("Applying dql credentials %s (%s)", $credentialDefinition["name"]);
                     $this->applyDQLCalls($query,$credentialDefinition["calls"],
                         $this->getCredentialValues($credentialDefinition["name"]));
                    break;
@@ -419,7 +420,7 @@ class API_Views_ApiDQLViewModel extends IcingaBaseModel {
         if(!$this->user->hasTarget($target,true))
             return array();
         if($target != IcingaIPrincipalConstants::TYPE_CONTACTGROUP) {
-            return $this->user->getTargetValues($target)->toArray();
+            return $this->user->getTargetValues($target, true)->toArray();
         }
 
         $targetValue = new NsmTargetValue();
diff --git a/app/modules/Api/models/Views/Extender/CustomVariableExtenderModel.class.php b/app/modules/Api/models/Views/Extender/CustomVariableExtenderModel.class.php
index a560bab..5e52124 100644
--- a/app/modules/Api/models/Views/Extender/CustomVariableExtenderModel.class.php
+++ b/app/modules/Api/models/Views/Extender/CustomVariableExtenderModel.class.php
@@ -54,7 +54,7 @@ class Api_Views_Extender_CustomVariableExtenderModel extends IcingaBaseModel
                     $objectTypeClause .= "2";
                 break;
         }
-        $targetVals = $this->user->getTargetValues($target)->toArray();
+        $targetVals = $this->user->getTargetValues($target,true)->toArray();
         if(empty($targetVals))
            return;
         if($joinType == "left")
@@ -73,4 +73,4 @@ class Api_Views_Extender_CustomVariableExtenderModel extends IcingaBaseModel
             );
         }
     }
-}
\ No newline at end of file
+}
diff --git a/app/modules/Api/models/Views/Extender/NotificationCustomVariableExtenderModel.class.php b/app/modules/Api/models/Views/Extender/NotificationCustomVariableExtenderModel.class.php
index 4b49c49..cbce9ac 100644
--- a/app/modules/Api/models/Views/Extender/NotificationCustomVariableExtenderModel.class.php
+++ b/app/modules/Api/models/Views/Extender/NotificationCustomVariableExtenderModel.class.php
@@ -37,11 +37,11 @@ class Api_Views_Extender_NotificationCustomVariableExtenderModel extends IcingaB
         $this->user = $this->getContext()->getUser()->getNsmUser();
        
         $svc_targetVals = $this->user->
-                getTargetValues(IcingaIPrincipalConstants::TYPE_CUSTOMVAR_SERVICE)
+                getTargetValues(IcingaIPrincipalConstants::TYPE_CUSTOMVAR_SERVICE, true)
                 ->toArray();
 
         $host_targetVals = $this->user->
-                getTargetValues(IcingaIPrincipalConstants::TYPE_CUSTOMVAR_HOST)
+                getTargetValues(IcingaIPrincipalConstants::TYPE_CUSTOMVAR_HOST, true)
                 ->toArray();
         
         if(empty($svc_targetVals) && empty($host_targetvals)) {
@@ -85,4 +85,4 @@ class Api_Views_Extender_NotificationCustomVariableExtenderModel extends IcingaB
         }
         return $cvPart;
     }
-}
\ No newline at end of file
+}





More information about the icinga-checkins mailing list