diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-14 21:17:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-14 21:17:37 +0300 |
commit | a845362ebc7e14d2098223107d58625bb9423164 (patch) | |
tree | fe593663f0acbc1499b06d7c89fbe0480c2f0fed /app/controllers | |
parent | e74bf51e817ee50e85b1bbdc34f0443d1088fd68 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/merge_requests/application_controller.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/controllers/projects/merge_requests/application_controller.rb b/app/controllers/projects/merge_requests/application_controller.rb index 6d1b1ced4eb..81ff6c215f9 100644 --- a/app/controllers/projects/merge_requests/application_controller.rb +++ b/app/controllers/projects/merge_requests/application_controller.rb @@ -14,6 +14,18 @@ class Projects::MergeRequests::ApplicationController < Projects::ApplicationCont private + # Normally the methods with `check_(\w+)_available!` pattern are + # handled by the `method_missing` defined in `ProjectsController::ApplicationController` + # but that logic does not take the member roles into account, therefore, we handle this + # case here manually. + def check_merge_requests_available! + render_404 if project_policy.merge_requests_disabled? + end + + def project_policy + ProjectPolicy.new(current_user, project) + end + def merge_request @issuable = @merge_request ||= |