|
@@ 293-296 (lines=4) @@
|
| 290 |
|
$fileIds = $vars['ids']; |
| 291 |
|
$files = $this->getList()->filter("ID", $fileIds)->toArray(); |
| 292 |
|
|
| 293 |
|
if (!count($files)) { |
| 294 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 404)) |
| 295 |
|
->addHeader('Content-Type', 'application/json'); |
| 296 |
|
} |
| 297 |
|
|
| 298 |
|
if (!min(array_map(function (File $file) { |
| 299 |
|
return $file->canArchive(); |
|
@@ 755-758 (lines=4) @@
|
| 752 |
|
/** @var File $record */ |
| 753 |
|
$record = $this->getList()->filter('ID', $id)->first(); |
| 754 |
|
|
| 755 |
|
if (!$record) { |
| 756 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 404)) |
| 757 |
|
->addHeader('Content-Type', 'application/json'); |
| 758 |
|
} |
| 759 |
|
|
| 760 |
|
if (!$record->canEdit() || ($doPublish && !$record->canPublish())) { |
| 761 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 401)) |