/** * @param integer $folder_id */ function __construct($folder_id) { if (is_numeric($folder_id)) { global $user; parent::__construct($folder_id); $this->organisation_unit_folder = new FolderIsOrganisationUnitFolder_Access($folder_id); $this->organisation_unit_id = $this->organisation_unit_folder->get_organisation_unit_id(); $organisation_unit = new OrganisationUnit($this->organisation_unit_id); if ($organisation_unit->is_user_in_organisation_unit($user->get_user_id()) == true or $organisation_unit->is_leader_in_organisation_unit($user->get_user_id()) == true or $organisation_unit->is_owner_in_organisation_unit($user->get_user_id()) == true or $organisation_unit->is_quality_manager_in_organisation_unit($user->get_user_id()) == true) { if ($this->read_access == false) { $this->data_entity_permission->set_read_permission(); if ($this->data_entity_permission->is_access(1)) { $this->read_access = true; } } if ($this->write_access == false) { $this->data_entity_permission->set_write_permission(); if ($this->data_entity_permission->is_access(2)) { $this->write_access = true; } } } } else { parent::__construct(null); $this->organisation_unit_folder = null; $this->organisation_unit_id = null; } }