admin能访问问卷列表

This commit is contained in:
sw 2015-07-10 10:05:28 +08:00
parent 11191f6743
commit 851b468e8d
1 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ class PollController < ApplicationController
def show
@poll = Poll.find params[:id]
if @poll.polls_status != 2 && !User.current.allowed_to?(:as_teacher,@course)
if @poll.polls_status != 2 && (!User.current.allowed_to?(:as_teacher,@course) || User.current.admin?)
render_403
return
end
@ -393,7 +393,7 @@ class PollController < ApplicationController
end
def is_member_of_course
render_403 unless(@course && User.current.member_of_course?(@course))
render_403 unless(@course && (User.current.member_of_course?(@course) || User.current.admin?))
end
def is_course_teacher