修改老师无法修改班级成员角色的BUG
This commit is contained in:
parent
a6241afe04
commit
7c928703b5
|
@ -569,14 +569,20 @@ module Mobile
|
||||||
roles_id << 10
|
roles_id << 10
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
c = Course.find("#{params[:id]}")
|
c = Course.find("#{params[:id]}")
|
||||||
|
|
||||||
#7教辅 9教师 10学生
|
my_member = c.member_principals.where("users.id=#{current_user.id}").first
|
||||||
if c.tea_id == params[:user_id] || c.tea_id != current_user.id || roles_id.length <= 0
|
|
||||||
present :status, -1
|
|
||||||
else
|
|
||||||
|
|
||||||
|
rolesids = []
|
||||||
|
my_member.roles.each do |role|
|
||||||
|
rolesids << role.id
|
||||||
|
end
|
||||||
|
|
||||||
|
#7教辅 9教师 10学生
|
||||||
|
if c.tea_id == params[:user_id] || roles_id.length <= 0 || rolesids.include?(10)
|
||||||
|
present :status, -1
|
||||||
|
present :message,"修改失败"
|
||||||
|
else
|
||||||
cs = CoursesService.new
|
cs = CoursesService.new
|
||||||
status = cs.modify_user_course_role params,roles_id
|
status = cs.modify_user_course_role params,roles_id
|
||||||
present :status, status
|
present :status, status
|
||||||
|
|
Loading…
Reference in New Issue