Module: ControllerWithCrossProjectAccessCheck

Extended by:
ActiveSupport::Concern
Included in:
Boards::IssuesController, Dashboard::ApplicationController, Groups::ApplicationController, Groups::Clusters::ApplicationsController, 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


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

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
14
15
# File 'app/controllers/concerns/controller_with_cross_project_access_check.rb', line 11

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