'Determines whether or not the user for this request is authorized to view the given asset.'

def is_user_authorized(self, request, content, location):

    if (not self.is_content_locked(content)):
        return True
    if ((not hasattr(request, 'user')) or (not request.user.is_authenticated())):
        return False
    if (not request.user.is_staff):
        deprecated = getattr(location, 'deprecated', False)
        if (deprecated and (not CourseEnrollment.is_enrolled_by_partial(request.user, location.course_key))):
            return False
        if ((not deprecated) and (not CourseEnrollment.is_enrolled(request.user, location.course_key))):
            return False
    return True
