def _has_access_error_desc(user, action, descriptor, course_key):
 def check_for_staff():
  return _has_staff_access_to_descriptor(user, descriptor, course_key)
 checkers = {'load': check_for_staff, 'staff': check_for_staff, 'instructor': (lambda : _has_instructor_access_to_descriptor(user, descriptor, course_key))}
 return _dispatch(checkers, action, user, descriptor)

def _has_access_error_desc ( user , action , descriptor , course_key ) : def check_for_staff ( ) : return _has_staff_access_to_descriptor ( user , descriptor , course_key ) checkers = { 'load' : check_for_staff , 'staff' : check_for_staff , 'instructor' : ( lambda : _has_instructor_access_to_descriptor ( user , descriptor , course_key ) ) } return _dispatch ( checkers , action , user , descriptor )
only staff should see error descriptors .