diff options
author | Jan Beckmann <king-jan1999@hotmail.de> | 2019-03-08 08:34:20 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-03-08 08:34:20 +0000 |
commit | eba4b9404f152f6ad8c4be62116cbe5fd0662b0d (patch) | |
tree | e2dd3ecdbf30d35eed819b5a6f71cd40f152b9d5 /app/policies | |
parent | 6648188121ba8c044f104ff491a3b20a53167c64 (diff) | |
download | gitlab-ce-eba4b9404f152f6ad8c4be62116cbe5fd0662b0d.tar.gz |
Disallow reopening of locked merge requests
Fixes #56864
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/issuable_policy.rb | 1 | ||||
-rw-r--r-- | app/policies/merge_request_policy.rb | 3 | ||||
-rw-r--r-- | app/policies/project_policy.rb | 1 |
3 files changed, 5 insertions, 0 deletions
diff --git a/app/policies/issuable_policy.rb b/app/policies/issuable_policy.rb index ecb2797d1d9..537319addc2 100644 --- a/app/policies/issuable_policy.rb +++ b/app/policies/issuable_policy.rb @@ -17,6 +17,7 @@ class IssuablePolicy < BasePolicy enable :reopen_issue enable :read_merge_request enable :update_merge_request + enable :reopen_merge_request end rule { locked & ~is_project_member }.policy do diff --git a/app/policies/merge_request_policy.rb b/app/policies/merge_request_policy.rb index a2950951d03..a3692857ff4 100644 --- a/app/policies/merge_request_policy.rb +++ b/app/policies/merge_request_policy.rb @@ -1,4 +1,7 @@ # frozen_string_literal: true class MergeRequestPolicy < IssuablePolicy + rule { locked }.policy do + prevent :reopen_merge_request + end end diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index cf257ed47c8..9f9f5230040 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -231,6 +231,7 @@ class ProjectPolicy < BasePolicy enable :admin_merge_request enable :admin_milestone enable :update_merge_request + enable :reopen_merge_request enable :create_commit_status enable :update_commit_status enable :create_build |