Skip to content

Include authorization check in Npm::CreatePackageService

What does this MR do and why?

Based on the review discussion in another MR, this MR is intented as a follow-up of the MR !125415 (merged).

This MR includes:

  • An authorization check for the given user in Npm::CreatePackageService
  • Small refactoring of the test case to align more with testing style guide

🛠 with at Siemens

Screenshots or screen recordings

In Npm::CreatePackageService checks if the given user has the permission to create package. This authorization check was not done before as discussed in !125415 (comment 1462458380).

How to set up and validate locally

Just execute the following test

bundle exec rspec spec/services/packages/npm/create_package_service_spec.rb

TODOs

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #418796

Edited by Gerardo Navarro

Merge request reports