def get_course_and_check_access(course_key, user, depth=0):
 if (not has_studio_read_access(user, course_key)):
  raise PermissionDenied()
 course_module = modulestore().get_course(course_key, depth=depth)
 return course_module

def get_course_and_check_access ( course_key , user , depth = 0 ) : if ( not has_studio_read_access ( user , course_key ) ) : raise PermissionDenied ( ) course_module = modulestore ( ) . get_course ( course_key , depth = depth ) return course_module
internal method used to calculate and return the locator and course module for the view functions in this file .