Skip to content

Commit

Permalink
Remove the capability check in the Composer repository transformer.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bradyvercher committed Feb 26, 2021
1 parent ff73b3b commit c17a28f
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/Transformer/ComposerRepositoryTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) {
Expand Down

0 comments on commit c17a28f

Please sign in to comment.