summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-08-26 13:24:08 +0000
committerGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-08-26 13:24:08 +0000
commit4ac6465012475df1582ebc11cb7789b8cdce3efa (patch)
tree1402dd8e59387357658cf154d37ac82c262cec46 /app
parentc9b5d09a9fa3647f0aaf5eb93747bd8f6476504b (diff)
parent89ced3fb218d5a2c4ac24060993ae06fa7497c7f (diff)
downloadgitlab-ce-4ac6465012475df1582ebc11cb7789b8cdce3efa.tar.gz
Merge branch 'security-64711-fix-commit-todos-12-2' into '12-2-stable'
Send TODOs for comments on commits correctly See merge request gitlab/gitlabhq!3365
Diffstat (limited to 'app')
-rw-r--r--app/services/todo_service.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/services/todo_service.rb b/app/services/todo_service.rb
index 0ea230a44a1..b1256df35d6 100644
--- a/app/services/todo_service.rb
+++ b/app/services/todo_service.rb
@@ -314,11 +314,9 @@ class TodoService
end
def reject_users_without_access(users, parent, target)
- if target.is_a?(Note) && target.for_issuable?
- target = target.noteable
- end
+ target = target.noteable if target.is_a?(Note)
- if target.is_a?(Issuable)
+ if target.respond_to?(:to_ability_name)
select_users(users, :"read_#{target.to_ability_name}", target)
else
select_users(users, :read_project, parent)