def isRealmUser(self, realmname, username, environ):
        """Returns True if this username is valid for the realm, False otherwise."""
        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
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
Returns True if this username is valid for the realm, False otherwise.