Code Duplication    Length = 9-9 lines in 2 locations

code/Controller/AssetAdmin.php 2 locations

@@ 605-613 (lines=9) @@
602
        /** @var File $file */
603
        $file = $this->getList()->byID($id);
604
605
        if (!$file->canView()) {
606
            $this->httpError(403, _t(
607
                'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied',
608
                'You don\'t have the necessary permissions to modify {ObjectTitle}',
609
                '',
610
                ['ObjectTitle' => $file->i18n_singular_name()]
611
            ));
612
            return null;
613
        }
614
615
        $scaffolder = $this->getFormBuilder($file);
616
        $form = $scaffolder->getForm('FileEditForm');
@@ 933-941 (lines=9) @@
930
            ));
931
            return null;
932
        }
933
        if (!$record->canView()) {
934
            $this->httpError(403, _t(
935
                'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ErrorItemPermissionDenied',
936
                'You don\'t have the necessary permissions to modify {ObjectTitle}',
937
                '',
938
                ['ObjectTitle' => $record->i18n_singular_name()]
939
            ));
940
            return null;
941
        }
942
943
        $handler = AddToCampaignHandler::create($this, $record);
944
        return $handler->Form($record);