diff --git a/code/Controller/AssetAdmin.php b/code/Controller/AssetAdmin.php index 14d6542ed..5be50322f 100644 --- a/code/Controller/AssetAdmin.php +++ b/code/Controller/AssetAdmin.php @@ -1081,7 +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')) ? $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 642552fbb..06410f908 100644 --- a/code/GraphQL/Resolvers/AssetAdminResolver.php +++ b/code/GraphQL/Resolvers/AssetAdminResolver.php @@ -126,7 +126,7 @@ public static function resolveDeleteFiles($object, array $args, $context, Resolv $deletedIDs = []; $member = UserContextProvider::get($context); foreach ($files as $file) { - if ($file->canArchive($member)) { + 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 = []) {