Commit d37cf2a2 authored by Ciro Santilli's avatar Ciro Santilli

Factor permission check in issuable finder

parent ac158424
......@@ -44,7 +44,7 @@ class IssuableFinder
table_name = klass.table_name
if project
if project.public? || (current_user && current_user.can?(:read_project, project))
if Ability.abilities.allowed?(current_user, :read_project, project)
project.send(table_name)
else
[]
......
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