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
1 changed files with 1 additions and 1 deletions

View File

@ -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
[]