|
@@ 287-290 (lines=4) @@
|
| 284 |
|
$fileIds = $vars['ids']; |
| 285 |
|
$files = $this->getList()->filter("ID", $fileIds)->toArray(); |
| 286 |
|
|
| 287 |
|
if (!count($files)) { |
| 288 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 404)) |
| 289 |
|
->addHeader('Content-Type', 'application/json'); |
| 290 |
|
} |
| 291 |
|
|
| 292 |
|
if (!min(array_map(function (File $file) { |
| 293 |
|
return $file->canArchive(); |
|
@@ 704-707 (lines=4) @@
|
| 701 |
|
/** @var File $record */ |
| 702 |
|
$record = $this->getList()->filter('ID', $id)->first(); |
| 703 |
|
|
| 704 |
|
if (!$record) { |
| 705 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 404)) |
| 706 |
|
->addHeader('Content-Type', 'application/json'); |
| 707 |
|
} |
| 708 |
|
|
| 709 |
|
if (!$record->canEdit() || ($doPublish && !$record->canPublish())) { |
| 710 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 401)) |