diff options
Diffstat (limited to 'lib/banzai/filter/issue_reference_filter.rb')
-rw-r--r-- | lib/banzai/filter/issue_reference_filter.rb | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/banzai/filter/issue_reference_filter.rb b/lib/banzai/filter/issue_reference_filter.rb index 09a4d71b5f6..37e66387f2e 100644 --- a/lib/banzai/filter/issue_reference_filter.rb +++ b/lib/banzai/filter/issue_reference_filter.rb @@ -28,8 +28,24 @@ module Banzai def parent_records(parent, ids) parent.issues.where(iid: ids.to_a) end + + def object_link_text_extras(issue, matches) + super + design_link_extras(issue, matches.named_captures['path']) + end + + private + + def design_link_extras(issue, path) + if path == '/designs' && read_designs?(issue) + ['designs'] + else + [] + end + end + + def read_designs?(issue) + Ability.allowed?(current_user, :read_design, issue) + end end end end - -Banzai::Filter::IssueReferenceFilter.prepend_if_ee('EE::Banzai::Filter::IssueReferenceFilter') |