Use Ability.allowed? instead of current_user.can? in AccessRequestsFinder

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2016-09-27 15:52:30 +02:00
parent 5f88aafbf6
commit 486f755c4f

View file

@ -22,6 +22,6 @@ class AccessRequestsFinder
private
def can_see_access_requests?(current_user)
source && current_user && current_user.can?(:"admin_#{source.class.to_s.underscore}", source)
source && Ability.allowed?(current_user, :"admin_#{source.class.to_s.underscore}", source)
end
end