Code Duplication    Length = 9-9 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 674-682 (lines=9) @@
671
            return null;
672
        }
673
674
        if (!$file->canView()) {
675
            $this->httpError(403, _t(
676
                'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied',
677
                'You don\'t have the necessary permissions to modify {ObjectTitle}',
678
                '',
679
                ['ObjectTitle' => $file->i18n_singular_name()]
680
            ));
681
            return null;
682
        }
683
684
        // Pass to form factory
685
        $augmentedContext = array_merge($context, ['Record' => $file]);
@@ 751-759 (lines=9) @@
748
            return $this->httpError(404);
749
        }
750
751
        if (!$file->canView()) {
752
            $this->httpError(403, _t(
753
                'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied',
754
                'You don\'t have the necessary permissions to modify {ObjectTitle}',
755
                '',
756
                ['ObjectTitle' => $file->i18n_singular_name()]
757
            ));
758
            return null;
759
        }
760
761
        $effectiveContext = array_merge($context, ['Record' => $file]);
762
        /** @var FormFactory $scaffolder */
@@ 1118-1126 (lines=9) @@
1115
            ));
1116
            return null;
1117
        }
1118
        if (!$record->canView()) {
1119
            $this->httpError(403, _t(
1120
                'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied',
1121
                'You don\'t have the necessary permissions to modify {ObjectTitle}',
1122
                '',
1123
                ['ObjectTitle' => $record->i18n_singular_name()]
1124
            ));
1125
            return null;
1126
        }
1127
1128
        $handler = AddToCampaignHandler::create($this, $record, 'addToCampaignForm');
1129
        $form = $handler->Form($record);