'Create a new user.'

def create(self, webapp_name=None, **kwargs):

    email = kwargs['email']
    username = kwargs['username']
    password = kwargs['password']
    self._error_on_duplicate_email(email)
    user = model.User(email=email, password=password)
    user.username = username
    if self.app.config.user_activation_on:
        user.active = False
    else:
        user.active = True
    self.session().add(user)
    try:
        self.session().flush()
    except sqlalchemy.exc.IntegrityError as db_err:
        raise exceptions.Conflict(db_err.message)
    self.app.security_agent.create_private_user_role(user)
    if (webapp_name == 'galaxy'):
        permissions = self.app.config.new_user_dataset_access_role_default_private
        self.app.security_agent.user_set_default_permissions(user, default_access_private=permissions)
    return user
