mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
Portal : Allowed Organizations part for action rules.
SVN:trunk[4428]
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
// iTop is free software; you can redistribute it and/or modify
|
// iTop is free software; you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU Affero General Public License as published by
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
@@ -23,6 +23,7 @@ use \Exception;
|
|||||||
use \Silex\Application;
|
use \Silex\Application;
|
||||||
use \DOMNodeList;
|
use \DOMNodeList;
|
||||||
use \DOMFormatException;
|
use \DOMFormatException;
|
||||||
|
use \UserRights;
|
||||||
use \DBObject;
|
use \DBObject;
|
||||||
use \DBSearch;
|
use \DBSearch;
|
||||||
use \DBObjectSet;
|
use \DBObjectSet;
|
||||||
@@ -42,6 +43,7 @@ class ContextManipulatorHelper
|
|||||||
const ENUM_RULE_CALLBACK_OPEN_EDIT = 'edit';
|
const ENUM_RULE_CALLBACK_OPEN_EDIT = 'edit';
|
||||||
const DEFAULT_RULE_CALLBACK_OPEN = self::ENUM_RULE_CALLBACK_OPEN_VIEW;
|
const DEFAULT_RULE_CALLBACK_OPEN = self::ENUM_RULE_CALLBACK_OPEN_VIEW;
|
||||||
|
|
||||||
|
protected $oApp;
|
||||||
protected $aRules;
|
protected $aRules;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
@@ -59,7 +61,7 @@ class ContextManipulatorHelper
|
|||||||
public function Init(DOMNodeList $oNodes)
|
public function Init(DOMNodeList $oNodes)
|
||||||
{
|
{
|
||||||
$this->aRules = array();
|
$this->aRules = array();
|
||||||
|
|
||||||
// Iterating over the scope nodes
|
// Iterating over the scope nodes
|
||||||
foreach ($oNodes as $oRuleNode)
|
foreach ($oNodes as $oRuleNode)
|
||||||
{
|
{
|
||||||
@@ -181,6 +183,11 @@ class ContextManipulatorHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function SetApp($oApp)
|
||||||
|
{
|
||||||
|
$this->oApp = $oApp;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a hash array of rules
|
* Returns a hash array of rules
|
||||||
*
|
*
|
||||||
@@ -222,7 +229,7 @@ class ContextManipulatorHelper
|
|||||||
* ...
|
* ...
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
* @param array $aData
|
* @param array $aData
|
||||||
* @param DBObject $oObject
|
* @param DBObject $oObject
|
||||||
*/
|
*/
|
||||||
@@ -290,6 +297,13 @@ class ContextManipulatorHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Checking for silos
|
||||||
|
$oScopeSearch = $this->oApp['scope_validator']->GetScopeFilterForProfiles(UserRights::ListProfiles(), $sSearchClass, UR_ACTION_READ);
|
||||||
|
if ($oScopeSearch->IsAllDataAllowed())
|
||||||
|
{
|
||||||
|
$oSearch->AllowAllData();
|
||||||
|
}
|
||||||
|
|
||||||
// Retrieving source object(s) and applying rules
|
// Retrieving source object(s) and applying rules
|
||||||
$oSet = new DBObjectSet($oSearch, array(), $aSearchParams);
|
$oSet = new DBObjectSet($oSearch, array(), $aSearchParams);
|
||||||
while ($oSourceObject = $oSet->Fetch())
|
while ($oSourceObject = $oSet->Fetch())
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ class ContextManipulatorServiceProvider implements ServiceProviderInterface
|
|||||||
$oApp->flush();
|
$oApp->flush();
|
||||||
|
|
||||||
$oContextManipulatorHelper = new ContextManipulatorHelper();
|
$oContextManipulatorHelper = new ContextManipulatorHelper();
|
||||||
|
$oContextManipulatorHelper->SetApp($oApp);
|
||||||
|
|
||||||
return $oContextManipulatorHelper;
|
return $oContextManipulatorHelper;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user