|
@@ 356-359 (lines=4) @@
|
| 353 |
|
$fileIds = $vars['ids']; |
| 354 |
|
$files = $this->getList()->filter("ID", $fileIds)->toArray(); |
| 355 |
|
|
| 356 |
|
if (!count($files)) { |
| 357 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 404)) |
| 358 |
|
->addHeader('Content-Type', 'application/json'); |
| 359 |
|
} |
| 360 |
|
|
| 361 |
|
if (!min(array_map(function (File $file) { |
| 362 |
|
return $file->canArchive(); |
|
@@ 1029-1032 (lines=4) @@
|
| 1026 |
|
/** @var File $record */ |
| 1027 |
|
$record = $this->getList()->filter('ID', $id)->first(); |
| 1028 |
|
|
| 1029 |
|
if (!$record) { |
| 1030 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 404)) |
| 1031 |
|
->addHeader('Content-Type', 'application/json'); |
| 1032 |
|
} |
| 1033 |
|
|
| 1034 |
|
if (!$record->canEdit() || ($doPublish && !$record->canPublish())) { |
| 1035 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 401)) |