diff options
Diffstat (limited to 'app/controllers/concerns/project_unauthorized.rb')
-rw-r--r-- | app/controllers/concerns/project_unauthorized.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/controllers/concerns/project_unauthorized.rb b/app/controllers/concerns/project_unauthorized.rb index d42363b8b17..7238840440f 100644 --- a/app/controllers/concerns/project_unauthorized.rb +++ b/app/controllers/concerns/project_unauthorized.rb @@ -1,10 +1,12 @@ # frozen_string_literal: true module ProjectUnauthorized - def project_unauthorized_proc - lambda do |project| - if project - label = project.external_authorization_classification_label + module ControllerActions + def self.on_routable_not_found + lambda do |routable| + return unless routable.is_a?(Project) + + label = routable.external_authorization_classification_label rejection_reason = nil unless ::Gitlab::ExternalAuthorization.access_allowed?(current_user, label) @@ -12,9 +14,7 @@ module ProjectUnauthorized rejection_reason ||= _('External authorization denied access to this project') end - if rejection_reason - access_denied!(rejection_reason) - end + access_denied!(rejection_reason) if rejection_reason end end end |