This method assigns a role to a user. The user must be already set before processing this API method.
<?php UM()->roles()->set_role( $user_id, $role ); ?>
(integer)(required) The user id.
(string) (required) The user role slug you want to assign to the user.
Changes user role if the given user role was a valid plugin role.
Set a user and give them the role of community-member
//Change user role UM()->roles()->set_role(112,'community-member'); ?>