From e791339c4ee2e39cfc1d73beb03fcefa78c1bd8a Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 1 Dec 2014 22:00:42 +0800 Subject: [PATCH] fix for frontend authorization --- app/helpers/orbit_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/helpers/orbit_helper.rb b/app/helpers/orbit_helper.rb index 9196527..2b87dfc 100644 --- a/app/helpers/orbit_helper.rb +++ b/app/helpers/orbit_helper.rb @@ -168,7 +168,9 @@ module OrbitHelper if @current_user.is_admin? or @current_user.is_manager?(@module_app) return true else - return @current_user.approved_categories.include?cat rescue false + category = Category.find(cat) rescue nil + return false if category.nil? + return @current_user.approved_categories.include?category rescue false end end