Skip to content

Prefer `except` over `only` in ImportsController

The following discussion from !35667 (merged) should be addressed:

  • @splattael started a discussion:

    Non-blocking and just a thought:

    I wonder if we should use

      before_action :authorize_admin_project!, except: :show
      before_action :require_namespace_project_creation_permission, only: :show
      before_action :require_no_repo, except: :show
      before_action :redirect_if_progress, except: :show
      before_action :redirect_if_no_import, only: :show

    just to be on the safe side in the case that we'd add a new action to this controller.

    Looking at the git history of this controller it seems it started this way back in 9d937293 but was changed in 46c36e0e.

    Having said that I fine leaving it as-is for now.

    Thoughts?