Code Duplication    Length = 9-9 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

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