diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-07-10 09:38:42 +0200 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-07-24 08:13:43 +0200 |
commit | 7bee7b848aab883a6869e1fd2fbb9e66182d2023 (patch) | |
tree | 286029930e7c9af9402a752a1dd6f2ab9c607776 /lib/banzai | |
parent | 2fa22a07296223c1239bfab94654487cca222097 (diff) | |
download | gitlab-ce-7bee7b848aab883a6869e1fd2fbb9e66182d2023.tar.gz |
Support both internal and external issue trackers
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/issue_reference_filter.rb | 2 | ||||
-rw-r--r-- | lib/banzai/reference_parser/external_issue_parser.rb | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/banzai/filter/issue_reference_filter.rb b/lib/banzai/filter/issue_reference_filter.rb index ba1a5ac84b3..ce1ab977d3b 100644 --- a/lib/banzai/filter/issue_reference_filter.rb +++ b/lib/banzai/filter/issue_reference_filter.rb @@ -20,7 +20,7 @@ module Banzai end def url_for_object(issue, project) - IssuesHelper.url_for_issue(issue.iid, project, only_path: context[:only_path]) + IssuesHelper.url_for_issue(issue.iid, project, only_path: context[:only_path], internal: true) end def project_from_ref(ref) diff --git a/lib/banzai/reference_parser/external_issue_parser.rb b/lib/banzai/reference_parser/external_issue_parser.rb index 6307c1b571a..1802cd04854 100644 --- a/lib/banzai/reference_parser/external_issue_parser.rb +++ b/lib/banzai/reference_parser/external_issue_parser.rb @@ -21,10 +21,14 @@ module Banzai gather_attributes_per_project(nodes, self.class.data_attribute) end - private - + # we extract only external issue trackers references here, we don't extract cross-project references, + # so we don't need to do anything here. def can_read_reference?(user, ref_project, node) - can?(user, :read_issue, ref_project) + true + end + + def nodes_visible_to_user(user, nodes) + nodes end end end |