|
@@ 310-313 (lines=4) @@
|
| 307 |
|
$fileIds = $vars['ids']; |
| 308 |
|
$files = $this->getList()->filter("ID", $fileIds)->toArray(); |
| 309 |
|
|
| 310 |
|
if (!count($files)) { |
| 311 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 404)) |
| 312 |
|
->addHeader('Content-Type', 'application/json'); |
| 313 |
|
} |
| 314 |
|
|
| 315 |
|
if (!min(array_map(function (File $file) { |
| 316 |
|
return $file->canArchive(); |
|
@@ 886-889 (lines=4) @@
|
| 883 |
|
/** @var File $record */ |
| 884 |
|
$record = $this->getList()->filter('ID', $id)->first(); |
| 885 |
|
|
| 886 |
|
if (!$record) { |
| 887 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 404)) |
| 888 |
|
->addHeader('Content-Type', 'application/json'); |
| 889 |
|
} |
| 890 |
|
|
| 891 |
|
if (!$record->canEdit() || ($doPublish && !$record->canPublish())) { |
| 892 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 401)) |