|
|
|
@ -552,7 +552,7 @@ class CoursesController < ApplicationController
|
|
|
|
|
def change_member_role
|
|
|
|
|
tip_exception("请至少选择一个角色") if params[:roles].blank?
|
|
|
|
|
tip_exception("不能具有老师、助教两种角色") if params[:roles].include?("PROFESSOR") && params[:roles].include?("ASSISTANT_PROFESSOR")
|
|
|
|
|
tip_exception("管理员不能切换为助教或老师") if @user_course_identity == Course::CREATOR &&
|
|
|
|
|
tip_exception("管理员不能切换为助教或老师") if params[:user_id].to_i == @course.tea_id &&
|
|
|
|
|
(params[:roles].include?("PROFESSOR") || params[:roles].include?("ASSISTANT_PROFESSOR"))
|
|
|
|
|
|
|
|
|
|
course_members = @course.course_members.where(user_id: params[:user_id])
|
|
|
|
|