|
@@ 359-362 (lines=4) @@
|
| 356 |
|
$fileIds = $vars['ids']; |
| 357 |
|
$files = $this->getList()->filter("ID", $fileIds)->toArray(); |
| 358 |
|
|
| 359 |
|
if (!count($files)) { |
| 360 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 404)) |
| 361 |
|
->addHeader('Content-Type', 'application/json'); |
| 362 |
|
} |
| 363 |
|
|
| 364 |
|
if (!min(array_map(function (File $file) { |
| 365 |
|
return $file->canArchive(); |
|
@@ 1099-1102 (lines=4) @@
|
| 1096 |
|
/** @var File $record */ |
| 1097 |
|
$record = DataObject::get_by_id(File::class, $id); |
| 1098 |
|
|
| 1099 |
|
if (!$record) { |
| 1100 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 404)) |
| 1101 |
|
->addHeader('Content-Type', 'application/json'); |
| 1102 |
|
} |
| 1103 |
|
|
| 1104 |
|
if (!$record->canEdit() || ($doPublish && !$record->canPublish())) { |
| 1105 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 401)) |