Commit f5e43f07 authored by Katarzyna Kobierska's avatar Katarzyna Kobierska

Prevent rendering the link when the author has no access

parent 71345998
...@@ -106,6 +106,9 @@ module Banzai ...@@ -106,6 +106,9 @@ module Banzai
project = context[:project] project = context[:project]
author = context[:author] author = context[:author]
if author && !project.team.member?(author)
'@all'
else
url = urls.namespace_project_url(project.namespace, project, url = urls.namespace_project_url(project.namespace, project,
only_path: context[:only_path]) only_path: context[:only_path])
...@@ -114,6 +117,7 @@ module Banzai ...@@ -114,6 +117,7 @@ module Banzai
link_tag(url, data, text, 'All Project and Group Members') link_tag(url, data, text, 'All Project and Group Members')
end end
end
def link_to_namespace(namespace, link_text: nil) def link_to_namespace(namespace, link_text: nil)
if namespace.is_a?(Group) if namespace.is_a?(Group)
......
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