Code Duplication    Length = 9-9 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 713-721 (lines=9) @@
710
            return null;
711
        }
712
713
        if (!$file->canView()) {
714
            $this->httpError(403, _t(
715
                'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied',
716
                'You don\'t have the necessary permissions to modify {ObjectTitle}',
717
                '',
718
                ['ObjectTitle' => $file->i18n_singular_name()]
719
            ));
720
            return null;
721
        }
722
723
        // Pass to form factory
724
        $augmentedContext = array_merge($context, ['Record' => $file]);
@@ 790-798 (lines=9) @@
787
            return $this->httpError(404);
788
        }
789
790
        if (!$file->canView()) {
791
            $this->httpError(403, _t(
792
                'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied',
793
                'You don\'t have the necessary permissions to modify {ObjectTitle}',
794
                '',
795
                ['ObjectTitle' => $file->i18n_singular_name()]
796
            ));
797
            return null;
798
        }
799
800
        $effectiveContext = array_merge($context, ['Record' => $file]);
801
        /** @var FormFactory $scaffolder */
@@ 1157-1165 (lines=9) @@
1154
            ));
1155
            return null;
1156
        }
1157
        if (!$record->canView()) {
1158
            $this->httpError(403, _t(
1159
                'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied',
1160
                'You don\'t have the necessary permissions to modify {ObjectTitle}',
1161
                '',
1162
                ['ObjectTitle' => $record->i18n_singular_name()]
1163
            ));
1164
            return null;
1165
        }
1166
1167
        $handler = AddToCampaignHandler::create($this, $record, 'addToCampaignForm');
1168
        $form = $handler->Form($record);