def add_course_author(user, course):
 global_admin = AdminFactory()
 for role in (CourseStaffRole, CourseInstructorRole):
  auth.add_users(global_admin, role(course.id), user)

def add_course_author ( user , course ) : global_admin = AdminFactory ( ) for role in ( CourseStaffRole , CourseInstructorRole ) : auth . add_users ( global_admin , role ( course . id ) , user )
add the user to the instructor group of the course so they will have the permissions to see it in studio .