Selaa lähdekoodia

Automatically add an id on the user rights profile/actions to allow a finer granularity for the deltas.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3305 a333f486-631f-4898-b8df-5754b55c2be0
romainq 10 vuotta sitten
vanhempi
commit
b90caa5c3e
1 muutettua tiedostoa jossa 11 lisäystä ja 0 poistoa
  1. 11 0
      setup/modelfactory.class.inc.php

+ 11 - 0
setup/modelfactory.class.inc.php

@@ -442,6 +442,17 @@ class ModelFactory
 					}
 				}
 				
+				// Adjust the XML to transparently add an id (=type:<type>) on all allowed actions (profiles)
+				// which don't already have one
+				$oNodeList = $oXPath->query('/itop_design/user_rights/profiles/profile/groups/group/actions/action');	
+				foreach($oNodeList as $oNode)
+				{
+					if ($oNode->getAttribute('id') == '')
+					{
+						$oNode->SetAttribute('id', 'type:'.$oNode->getAttribute('xsi:type'));
+					}
+				}
+				
 				$oDeltaRoot = $oDocument->childNodes->item(0);
 				$this->LoadDelta($oDocument, $oDeltaRoot, $this->oDOMDocument);
 			}