code: def isRealmUser(self, realmname, username, environ):
          
          try:
              course = self.course_factory.get_course(realmname)
              ok = self.user_manager.has_admin_rights_on_course(course, username=username)
              return ok
          except:
              return False
docs: Returns True if this username is valid for the realm, False otherwise.