Memberpress: how to add users to groups upon Sign up

This came up in another post on Meta today, so I had a look at the code to confirm whether or not a user’s trust level can be reduced by adding them to a group that sets a lower trust level than the user’s current group. From looking at the code, I can see that this is not possible:

  def grant
    if @user.trust_level < @trust_level
      @user.change_trust_level!(@trust_level)
      @user.save!
    end
  end

If a user’s trust level is lower than the trust level that is granted by the group, adding the user to the group will update their trust level. Otherwise, there will be no change in the user’s trust level.