objectRestrictions === null) { $this->objectRestrictions = $this->loadObjectRestrictions($this->db(), $this->Auth()); } return $this->objectRestrictions; } /** * @return ObjectRestriction[] */ protected function loadObjectRestrictions(Db $db, Auth $auth) { return [ new HostgroupRestriction($db, $auth) ]; } public function allowsObject(IcingaObject $object) { foreach ($this->getObjectRestrictions() as $restriction) { if (! $restriction->allows($object)) { return false; } } return true; } }