This method assign a role to a user. The user must be already set before processing this API method.
<?php $ultimatemember->user->set_role( $role ); ?>
(string) (required) The user role slug you want to assign to user.
Changes user role if the given user role was a valid plugin role.
Set a user and give them the role community-member
// Sets a user. Can accept numeric user ID
um_fetch_user( 14 );
// Change user role