修改非课程成员能看到提交作业按钮

This commit is contained in:
sw 2014-11-21 11:33:11 +08:00
parent dc480ecd44
commit 3215786538
1 changed files with 1 additions and 1 deletions

View File

@ -328,7 +328,7 @@ module CoursesHelper
#当前用户是不是指定课程的学生
def is_cur_course_student course
#course.members.joins(:member_roles).where("member_roles.role_id IN (:role_id) and members.user_id = #{User.current.id}", {:role_id => StudentRoles}).count != 0
!(User.current.allowed_to?(:as_teacher,course))
User.current.logged? && User.current.member_of_course?(course) && !(User.current.allowed_to?(:as_teacher,course))
#修改:能新建占位且不能新建任务的角色判定为学生
#is_student = false
#@membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))