def WriteGRRUser(self,
                   username,
                   password=None,
                   ui_mode=None,
                   canary_mode=None,
                   user_type=None):
    """Writes user object for a user with a given name."""
    u = self.users.setdefault(username, rdf_objects.GRRUser(username=username))
    if password is not None:
      u.password = password
    if ui_mode is not None:
      u.ui_mode = ui_mode
    if canary_mode is not None:
      u.canary_mode = canary_mode
    if user_type is not None:
      u.user_type = user_type
Writes user object for a user with a given name.