diff --git a/code/Controller/AssetAdmin.php b/code/Controller/AssetAdmin.php index 5ae2da7b5..26f728421 100644 --- a/code/Controller/AssetAdmin.php +++ b/code/Controller/AssetAdmin.php @@ -1082,9 +1082,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 812be0569..297f2bbbf 100644 --- a/code/GraphQL/Resolvers/AssetAdminResolver.php +++ b/code/GraphQL/Resolvers/AssetAdminResolver.php @@ -127,8 +127,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 = []) {