|
@@ 349-352 (lines=4) @@
|
| 346 |
|
$fileIds = $vars['ids']; |
| 347 |
|
$files = $this->getList()->filter("ID", $fileIds)->toArray(); |
| 348 |
|
|
| 349 |
|
if (!count($files)) { |
| 350 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 404)) |
| 351 |
|
->addHeader('Content-Type', 'application/json'); |
| 352 |
|
} |
| 353 |
|
|
| 354 |
|
if (!min(array_map(function (File $file) { |
| 355 |
|
return $file->canArchive(); |
|
@@ 1005-1008 (lines=4) @@
|
| 1002 |
|
/** @var File $record */ |
| 1003 |
|
$record = $this->getList()->filter('ID', $id)->first(); |
| 1004 |
|
|
| 1005 |
|
if (!$record) { |
| 1006 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 404)) |
| 1007 |
|
->addHeader('Content-Type', 'application/json'); |
| 1008 |
|
} |
| 1009 |
|
|
| 1010 |
|
if (!$record->canEdit() || ($doPublish && !$record->canPublish())) { |
| 1011 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 401)) |