Factor permission check in issuable finder

This commit is contained in:
Ciro Santilli 2014-10-19 10:02:13 +02:00
parent ac1584249c
commit d37cf2a23d

View file

@ -44,7 +44,7 @@ class IssuableFinder
table_name = klass.table_name table_name = klass.table_name
if project 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) project.send(table_name)
else else
[] []