Commit f5e43f07 authored by Katarzyna Kobierska's avatar Katarzyna Kobierska

Prevent rendering the link when the author has no access

parent 71345998
......@@ -106,13 +106,17 @@ module Banzai
project = context[:project]
author = context[:author]
url = urls.namespace_project_url(project.namespace, project,
only_path: context[:only_path])
if author && !project.team.member?(author)
'@all'
else
url = urls.namespace_project_url(project.namespace, project,
only_path: context[:only_path])
data = data_attribute(project: project.id, author: author.try(:id))
text = link_text || User.reference_prefix + 'all'
data = data_attribute(project: project.id, author: author.try(:id))
text = link_text || User.reference_prefix + 'all'
link_tag(url, data, text, 'All Project and Group Members')
link_tag(url, data, text, 'All Project and Group Members')
end
end
def link_to_namespace(namespace, link_text: nil)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment