FIX: user can't export entity unless they are logged in

This commit is contained in:
Arpit Jalan 2016-05-05 19:12:37 +05:30
parent 53809d526c
commit 22d7ea1192
1 changed files with 1 additions and 0 deletions

View File

@ -271,6 +271,7 @@ class Guardian
end
def can_export_entity?(entity_type)
return false unless @user
return true if is_staff?
return false if entity_type == "admin"
UserExport.where(user_id: @user.id, created_at: (Time.zone.now.beginning_of_day..Time.zone.now.end_of_day)).count == 0