Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorcharlieablett <cablett@gitlab.com>2019-08-26 10:43:29 +0300
committercharlieablett <cablett@gitlab.com>2019-10-23 09:29:21 +0300
commit380743078d12540b0b783fac64d0f7541a5c14e1 (patch)
treee046162c93fe522cef55a162b16ecd2abb538aa1 /app
parentd793ddc585055740eff03bac28a390ef7ec247ff (diff)
Users without commit access cannot create notes
Diffstat (limited to 'app')
-rw-r--r--app/policies/commit_policy.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/policies/commit_policy.rb b/app/policies/commit_policy.rb
index 4d4f0ba9267..4b358c45ec2 100644
--- a/app/policies/commit_policy.rb
+++ b/app/policies/commit_policy.rb
@@ -4,4 +4,5 @@ class CommitPolicy < BasePolicy
delegate { @subject.project }
rule { can?(:download_code) }.enable :read_commit
+ rule { ~can?(:read_commit) }.prevent :create_note
end