|
@@ 830-838 (lines=9) @@
|
| 827 |
|
/** @var File $file */ |
| 828 |
|
$file = $this->getList()->byID($id); |
| 829 |
|
|
| 830 |
|
if (!$file->canView()) { |
| 831 |
|
$this->httpError(403, _t( |
| 832 |
|
'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied', |
| 833 |
|
'You don\'t have the necessary permissions to modify {ObjectTitle}', |
| 834 |
|
'', |
| 835 |
|
['ObjectTitle' => $file->i18n_singular_name()] |
| 836 |
|
)); |
| 837 |
|
return null; |
| 838 |
|
} |
| 839 |
|
|
| 840 |
|
// Pass to form factory |
| 841 |
|
$augmentedContext = array_merge($context, ['Record' => $file]); |
|
@@ 902-910 (lines=9) @@
|
| 899 |
|
return $this->httpError(404); |
| 900 |
|
} |
| 901 |
|
|
| 902 |
|
if (!$file->canView()) { |
| 903 |
|
$this->httpError(403, _t( |
| 904 |
|
'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied', |
| 905 |
|
'You don\'t have the necessary permissions to modify {ObjectTitle}', |
| 906 |
|
'', |
| 907 |
|
['ObjectTitle' => $file->i18n_singular_name()] |
| 908 |
|
)); |
| 909 |
|
return null; |
| 910 |
|
} |
| 911 |
|
|
| 912 |
|
$effectiveContext = array_merge($context, ['Record' => $file]); |
| 913 |
|
/** @var FormFactory $scaffolder */ |
|
@@ 1269-1277 (lines=9) @@
|
| 1266 |
|
)); |
| 1267 |
|
return null; |
| 1268 |
|
} |
| 1269 |
|
if (!$record->canView()) { |
| 1270 |
|
$this->httpError(403, _t( |
| 1271 |
|
'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied', |
| 1272 |
|
'You don\'t have the necessary permissions to modify {ObjectTitle}', |
| 1273 |
|
'', |
| 1274 |
|
['ObjectTitle' => $record->i18n_singular_name()] |
| 1275 |
|
)); |
| 1276 |
|
return null; |
| 1277 |
|
} |
| 1278 |
|
|
| 1279 |
|
$handler = AddToCampaignHandler::create($this, $record, 'addToCampaignForm'); |
| 1280 |
|
$form = $handler->Form($record); |