From 0814e7b41229d8a4ff9871390a5008ca48db3cae Mon Sep 17 00:00:00 2001 From: p31729568 Date: Sat, 15 Jun 2019 08:33:14 +0800 Subject: [PATCH] fix business not permission at ec major school show --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ceeb8b9b..601ebb8a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -135,7 +135,7 @@ class ApplicationController < ActionController::Base end def ec_public_auth major_school - unless User.current.admin? || major_school.template_major || major_school.school.users.where(:id => User.current.id).count > 0 || + unless admin_or_business? || major_school.template_major || major_school.school.users.where(:id => User.current.id).count > 0 || major_school.ec_major_school_users.where(:user_id => User.current.id).count > 0 || EcCourseUser.where(:user_id => User.current.id, :ec_course_id => EcCourse.where(:ec_year_id => major_school.ec_years.pluck(:id)).pluck(:id)).count > 0 render_403