def can_access_self_blocks(requesting_user, course_key):
 return ((requesting_user.id and CourseEnrollment.is_enrolled(requesting_user, course_key)) or has_access(requesting_user, CourseStaffRole.ROLE, course_key))

def can_access_self_blocks ( requesting_user , course_key ) : return ( ( requesting_user . id and CourseEnrollment . is_enrolled ( requesting_user , course_key ) ) or has_access ( requesting_user , CourseStaffRole . ROLE , course_key ) )
returns whether the requesting_user can access own blocks .