admin查看course和user列表
Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
parent
36ec204f40
commit
00c0ddc600
|
@ -622,7 +622,8 @@ class CoursesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
render_404
|
render_404 unless User.current.admin?
|
||||||
|
|
||||||
@course_type = params[:course_type]
|
@course_type = params[:course_type]
|
||||||
@school_id = params[:school_id]
|
@school_id = params[:school_id]
|
||||||
per_page_option = 10
|
per_page_option = 10
|
||||||
|
|
|
@ -358,8 +358,7 @@ class UsersController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
@groups = Group.all.sort
|
@groups = Group.all.sort
|
||||||
# render :layout => @user_base_tag
|
User.current.admin? ? (render :layout => @user_base_tag) : (render_404)
|
||||||
render_404
|
|
||||||
}
|
}
|
||||||
format.api
|
format.api
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue