Skip to content

Commit

Permalink
Merge pull request #513 from it-novum/ITC-1066
Browse files Browse the repository at this point in the history
[-] While creating the service hosts list decreased to the hosts from…
  • Loading branch information
nook24 authored Apr 6, 2017
2 parents 34cf4aa + 643cc26 commit ac487fc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/Controller/ServicesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,12 +704,18 @@ public function add() {
$this->loadModel('Customvariable');

$userContainerId = $this->Auth->user('container_id');
$myContainerId = $this->Tree->resolveChildrenOfContainerIds($this->MY_RIGHTS);
$myRights = $myContainerId;
if(!$this->hasRootPrivileges && ($rootKey = array_search(ROOT_CONTAINER, $myRights)) !== false){
unset($myRights[$rootKey]);
}
$hosts = $this->Host->find('list', [
'conditions' => [
'Host.host_type' => GENERIC_HOST
'Host.host_type' => GENERIC_HOST,
'Host.container_id' => $myRights
]
]);
$myContainerId = $this->Tree->resolveChildrenOfContainerIds($this->MY_RIGHTS);

$servicetemplates = $this->Servicetemplate->servicetemplatesByContainerId($myContainerId, 'list');
$timeperiods = $this->Timeperiod->find('list');
//container_id = 1 => ROOT
Expand Down

0 comments on commit ac487fc

Please sign in to comment.