Module: ControllerWithCrossProjectAccessCheck

Extended by:
ActiveSupport::Concern
Included in:
Dashboard::ApplicationController, Groups::ApplicationController, Groups::Clusters::IntegrationsController, Groups::ClustersController, SearchController, UsersController
Defined in:
app/controllers/concerns/controller_with_cross_project_access_check.rb

Instance Method Summary collapse

Instance Method Details

#authorize_cross_project_page!Object



15
16
17
18
19
20
21
22
23
# File 'app/controllers/concerns/controller_with_cross_project_access_check.rb', line 15

def authorize_cross_project_page!
  return if can?(current_user, :read_cross_project)

  rejection_message = _(
    "This page is unavailable because you are not allowed to read information "\
    "across multiple projects."
  )
  access_denied!(rejection_message)
end

#cross_project_checkObject



11
12
13
# File 'app/controllers/concerns/controller_with_cross_project_access_check.rb', line 11

def cross_project_check
  authorize_cross_project_page! if Gitlab::CrossProjectAccess.find_check(self)&.should_run?(self)
end