19declare(strict_types=1);
35 protected ExposedRecordsRepository $exposed_repo,
36 protected ResourceStatusRepository $status_repo,
37 protected RepoObjectHandler $repo_object_handler,
38 protected ExportHandler $export_handler,
39 protected PublishingSettings $publishing_settings,
40 protected SimpleDCXMLWriter $xml_writer,
45 public function block(
int $obj_id): void
47 $this->status_repo->setHarvestingBlocked($obj_id,
true);
52 return $this->
access->checkAccess(
'write',
'', $ref_id, $type, $obj_id);
55 public function unblock(
int $obj_id): void
57 $this->status_repo->setHarvestingBlocked($obj_id,
false);
62 return $this->
access->checkAccess(
'write',
'', $ref_id, $type, $obj_id);
65 public function publish(
int $obj_id,
string $type): void
67 $target_ref_id = $this->publishing_settings->getContainerRefIDForPublishing();
74 $target_ref_id = $this->publishing_settings->getContainerRefIDForPublishing();
75 return $this->
access->checkAccess(
'write',
'', $ref_id, $type, $obj_id) &&
76 $this->
access->checkAccess(
'create_' . $type,
'', $target_ref_id);
81 $this->exposed_repo->updateRecord($obj_id,
true,
null);
83 $ref_id = $this->status_repo->getHarvestRefID($obj_id);
85 $this->status_repo->deleteHarvestRefID($obj_id);
87 if ($this->publishing_settings->isAutomaticPublishingEnabled()) {
88 $this->
block($obj_id);
94 $harvested_ref_id = $this->status_repo->getHarvestRefID($obj_id);
95 return $this->
access->checkAccess(
'write',
'', $ref_id, $type, $obj_id) &&
96 $this->
access->checkAccess(
'delete',
'', $harvested_ref_id, $type, $obj_id);
99 public function submit(
int $obj_id): void
101 $target_ref_id = $this->publishing_settings->getContainerRefIDForEditorialStep();
107 $target_ref_id = $this->publishing_settings->getContainerRefIDForEditorialStep();
108 return $this->
access->checkAccess(
'write',
'', $ref_id, $type, $obj_id) &&
109 $this->
access->checkAccess(
'create_' . $type,
'', $target_ref_id);
112 public function accept(
int $obj_id,
string $type): void
114 $harvested_ref_id = $this->status_repo->getHarvestRefID($obj_id);
116 $publishing_ref_id = $this->publishing_settings->getContainerRefIDForPublishing();
117 $ref_id_in_publishing = $this->repo_object_handler->referenceObjectInTargetContainer($obj_id, $publishing_ref_id);
118 $this->status_repo->setHarvestRefID($obj_id, $ref_id_in_publishing);
127 $publishing_ref_id = $this->publishing_settings->getContainerRefIDForPublishing();
128 $harvested_ref_id = $this->status_repo->getHarvestRefID($obj_id);
129 return $this->
access->checkAccess(
'write',
'', $ref_id, $type, $obj_id) &&
130 $this->
access->checkAccess(
'delete',
'', $harvested_ref_id, $type, $obj_id) &&
131 $this->
access->checkAccess(
'create_' . $type,
'', $publishing_ref_id);
134 public function reject(
int $obj_id): void
136 $ref_id = $this->status_repo->getHarvestRefID($obj_id);
138 $this->status_repo->deleteHarvestRefID($obj_id);
140 if ($this->publishing_settings->isAutomaticPublishingEnabled()) {
141 $this->
block($obj_id);
147 $harvested_ref_id = $this->status_repo->getHarvestRefID($obj_id);
148 return $this->
access->checkAccess(
'write',
'', $ref_id, $type, $obj_id) &&
149 $this->
access->checkAccess(
'delete',
'', $harvested_ref_id, $type, $obj_id);
154 $new_ref_id = $this->repo_object_handler->referenceObjectInTargetContainer(
158 $this->status_repo->setHarvestRefID($obj_id, $new_ref_id);
160 if (!$this->export_handler->hasPublicAccessExport($obj_id)) {
161 $this->export_handler->createPublicAccessExport($obj_id);
168 $simple_dc_xml = $this->xml_writer->writeSimpleDCMetaData(
173 if ($this->exposed_repo->doesRecordExistForObjID($obj_id)) {
174 $this->exposed_repo->updateRecord(
180 $this->exposed_repo->createRecord(
190 if ($this->repo_object_handler->isOnlyReference(
$ref_id)) {
193 $this->repo_object_handler->deleteReference(
$ref_id);
198 return 'il__' . $type .
'_' . $obj_id;
Class ilAccessHandler Checks access for ILIAS objects.
Component logger with individual log levels by component id.