Commit 62282971 authored by Robert Speicher's avatar Robert Speicher

Rename `user_can_read_group?` to `user_can_reference_group?`

parent a803cd51
...@@ -78,7 +78,7 @@ module Gitlab ...@@ -78,7 +78,7 @@ module Gitlab
%(<a href="#{url}" class="#{klass}">@#{user}</a>) %(<a href="#{url}" class="#{klass}">@#{user}</a>)
elsif namespace = Namespace.find_by(path: user) elsif namespace = Namespace.find_by(path: user)
if namespace.is_a?(Group) if namespace.is_a?(Group)
if user_can_read_group?(namespace) if user_can_reference_group?(namespace)
url = group_url(user, only_path: context[:only_path]) url = group_url(user, only_path: context[:only_path])
%(<a href="#{url}" class="#{klass}">@#{user}</a>) %(<a href="#{url}" class="#{klass}">@#{user}</a>)
else else
...@@ -117,7 +117,7 @@ module Gitlab ...@@ -117,7 +117,7 @@ module Gitlab
only_path: context[:only_path]) only_path: context[:only_path])
end end
def user_can_read_group?(group) def user_can_reference_group?(group)
return false if context[:current_user].blank? return false if context[:current_user].blank?
Ability.abilities.allowed?(context[:current_user], :read_group, group) Ability.abilities.allowed?(context[:current_user], :read_group, group)
end end
......
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