Code Duplication    Length = 9-9 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 630-638 (lines=9) @@
627
        /** @var File $file */
628
        $file = $this->getList()->byID($id);
629
630
        if (!$file->canView()) {
631
            $this->httpError(403, _t(
632
                'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied',
633
                'You don\'t have the necessary permissions to modify {ObjectTitle}',
634
                '',
635
                ['ObjectTitle' => $file->i18n_singular_name()]
636
            ));
637
            return null;
638
        }
639
640
        $scaffolder = $this->getFormFactory($file);
641
        $form = $scaffolder->getForm($this, 'FileEditForm', [
@@ 682-690 (lines=9) @@
679
        /** @var File $file */
680
        $file = $this->getList()->byID($id);
681
        
682
        if (!$file->canView()) {
683
            $this->httpError(403, _t(
684
                'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied',
685
                'You don\'t have the necessary permissions to modify {ObjectTitle}',
686
                '',
687
                ['ObjectTitle' => $file->i18n_singular_name()]
688
            ));
689
            return null;
690
        }
691
        
692
        $scaffolder = $this->getFormFactory($file);
693
        $form = $scaffolder->getForm($this, 'FileInsertForm', [
@@ 1016-1024 (lines=9) @@
1013
            ));
1014
            return null;
1015
        }
1016
        if (!$record->canView()) {
1017
            $this->httpError(403, _t(
1018
                'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied',
1019
                'You don\'t have the necessary permissions to modify {ObjectTitle}',
1020
                '',
1021
                ['ObjectTitle' => $record->i18n_singular_name()]
1022
            ));
1023
            return null;
1024
        }
1025
1026
        $handler = AddToCampaignHandler::create($this, $record);
1027
        $form = $handler->Form($record);