From c17a28f518bd2a7a9780caf433d5943b97619d93 Mon Sep 17 00:00:00 2001 From: Brady Vercher Date: Fri, 26 Feb 2021 07:18:26 -0800 Subject: [PATCH] Remove the capability check in the Composer repository transformer. The capability check would have allowed packages or individual releases to be filtered from display in packages.json, but it assumes the transformer would only ever be used in the Composer route. Removing the capability check makes it possible to use the transformer in other scenarios. --- src/Transformer/ComposerRepositoryTransformer.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Transformer/ComposerRepositoryTransformer.php b/src/Transformer/ComposerRepositoryTransformer.php index 8e3d3ef..be92fa3 100644 --- a/src/Transformer/ComposerRepositoryTransformer.php +++ b/src/Transformer/ComposerRepositoryTransformer.php @@ -117,11 +117,6 @@ protected function transform_item( Package $package ): array { $data = []; foreach ( $package->get_releases() as $release ) { - // Skip if the current user can't view this release. - if ( ! current_user_can( Capabilities::VIEW_PACKAGE, $package, $release ) ) { - continue; - } - // Cache the release in case an artifact doesn't already exist for // the installed version. if ( $package->is_installed() && $package->is_installed_release( $release ) ) {