diff --git a/code/Controller/AssetAdmin.php b/code/Controller/AssetAdmin.php index 5ae2da7b5..5be50322f 100644 --- a/code/Controller/AssetAdmin.php +++ b/code/Controller/AssetAdmin.php @@ -28,7 +28,6 @@ use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPResponse; use SilverStripe\Core\Injector\Injector; -use SilverStripe\Dev\Deprecation; use SilverStripe\Forms\Form; use SilverStripe\Forms\FormFactory; use SilverStripe\ORM\ArrayList; @@ -1082,9 +1081,7 @@ public function getObjectFromData(File $file, $thumbnailLinks = true) $object['filename'] = $file->Filename; $object['url'] = $file->AbsoluteURL; $object['canEdit'] = $file->canEdit(); - $object['canDelete'] = ($file->hasMethod('canArchive')) - ? Deprecation::withNoReplacement(fn() => $file->canArchive()) - : $file->canDelete(); + $object['canDelete'] = $file->canDelete(); $owner = $file->Owner(); diff --git a/code/GraphQL/Resolvers/AssetAdminResolver.php b/code/GraphQL/Resolvers/AssetAdminResolver.php index c63f1a11c..ae41440cf 100644 --- a/code/GraphQL/Resolvers/AssetAdminResolver.php +++ b/code/GraphQL/Resolvers/AssetAdminResolver.php @@ -16,7 +16,6 @@ use SilverStripe\ORM\Filterable; use SilverStripe\Versioned\Versioned; use InvalidArgumentException; -use SilverStripe\Dev\Deprecation; /** * @deprecated 5.3.0 Will be moved to the silverstripe/graphql module @@ -137,8 +136,7 @@ public static function resolveDeleteFiles($object, array $args, $context, Resolv $deletedIDs = []; $member = UserContextProvider::get($context); foreach ($files as $file) { - $canArchive = Deprecation::withNoReplacement(fn() => $file->canArchive($member)); - if ($canArchive) { + if ($file->canDelete($member)) { $file->doArchive(); $deletedIDs[] = $file->ID; } diff --git a/tests/php/Controller/AssetAdminTest/FileExtension.php b/tests/php/Controller/AssetAdminTest/FileExtension.php index ae55b11b8..8727d54d0 100644 --- a/tests/php/Controller/AssetAdminTest/FileExtension.php +++ b/tests/php/Controller/AssetAdminTest/FileExtension.php @@ -28,14 +28,6 @@ public function canDelete($member = null) } } - public function canArchive($member = null) - { - if ($this->owner->Name === 'disallowCanDelete.txt') { - return false; - } - return $this->owner->canDelete($member); - } - public function canCreate($member = null, $context = []) {