From 00c0ddc600486e77749e08834668303168dbcbb8 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Tue, 27 Jan 2015 15:11:24 +0800 Subject: [PATCH] =?UTF-8?q?admin=E6=9F=A5=E7=9C=8Bcourse=E5=92=8Cuser?= =?UTF-8?q?=E5=88=97=E8=A1=A8=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 3 ++- app/controllers/users_controller.rb | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index b5e0362b3..e34993663 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -622,7 +622,8 @@ class CoursesController < ApplicationController end def index - render_404 + render_404 unless User.current.admin? + @course_type = params[:course_type] @school_id = params[:school_id] per_page_option = 10 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 58af43da3..e97615772 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -358,8 +358,7 @@ class UsersController < ApplicationController respond_to do |format| format.html { @groups = Group.all.sort - # render :layout => @user_base_tag - render_404 + User.current.admin? ? (render :layout => @user_base_tag) : (render_404) } format.api end