|
|
@ -287,6 +287,11 @@ class User < ApplicationRecord
|
|
|
|
course.course_members.exists?(user_id: id, role: [1,2,3], is_active: 1) || admin? || business?
|
|
|
|
course.course_members.exists?(user_id: id, role: [1,2,3], is_active: 1) || admin? || business?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 课堂的老师(创建者、老师、助教),不考虑超管和运营人员
|
|
|
|
|
|
|
|
def none_admin_teacher_of_course?(course)
|
|
|
|
|
|
|
|
course.course_members.exists?(user_id: id, role: [1,2,3], is_active: 1)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# 课堂的老师(创建者、老师、助教),不用考虑当前身份
|
|
|
|
# 课堂的老师(创建者、老师、助教),不用考虑当前身份
|
|
|
|
def teacher_of_course_non_active?(course)
|
|
|
|
def teacher_of_course_non_active?(course)
|
|
|
|
course.course_members.exists?(user_id: id, role: [1,2,3])
|
|
|
|
course.course_members.exists?(user_id: id, role: [1,2,3])
|
|
|
|