|
@@ 637-645 (lines=9) @@
|
| 634 |
|
/** @var File $file */ |
| 635 |
|
$file = $this->getList()->byID($id); |
| 636 |
|
|
| 637 |
|
if (!$file->canView()) { |
| 638 |
|
$this->httpError(403, _t( |
| 639 |
|
'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied', |
| 640 |
|
'You don\'t have the necessary permissions to modify {ObjectTitle}', |
| 641 |
|
'', |
| 642 |
|
['ObjectTitle' => $file->i18n_singular_name()] |
| 643 |
|
)); |
| 644 |
|
return null; |
| 645 |
|
} |
| 646 |
|
|
| 647 |
|
// Pass to form factory |
| 648 |
|
$augmentedContext = array_merge($context, ['Record' => $file]); |
|
@@ 709-717 (lines=9) @@
|
| 706 |
|
return $this->httpError(404); |
| 707 |
|
} |
| 708 |
|
|
| 709 |
|
if (!$file->canView()) { |
| 710 |
|
$this->httpError(403, _t( |
| 711 |
|
'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied', |
| 712 |
|
'You don\'t have the necessary permissions to modify {ObjectTitle}', |
| 713 |
|
'', |
| 714 |
|
['ObjectTitle' => $file->i18n_singular_name()] |
| 715 |
|
)); |
| 716 |
|
return null; |
| 717 |
|
} |
| 718 |
|
|
| 719 |
|
$effectiveContext = array_merge($context, ['Record' => $file]); |
| 720 |
|
/** @var FormFactory $scaffolder */ |
|
@@ 1082-1090 (lines=9) @@
|
| 1079 |
|
)); |
| 1080 |
|
return null; |
| 1081 |
|
} |
| 1082 |
|
if (!$record->canView()) { |
| 1083 |
|
$this->httpError(403, _t( |
| 1084 |
|
'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied', |
| 1085 |
|
'You don\'t have the necessary permissions to modify {ObjectTitle}', |
| 1086 |
|
'', |
| 1087 |
|
['ObjectTitle' => $record->i18n_singular_name()] |
| 1088 |
|
)); |
| 1089 |
|
return null; |
| 1090 |
|
} |
| 1091 |
|
|
| 1092 |
|
$handler = AddToCampaignHandler::create($this, $record, 'addToCampaignForm'); |
| 1093 |
|
$form = $handler->Form($record); |