Update sync-gw users role

Hi team,
I have to update all the sync-gw users role through a process. we can write a batch to do this but is there a better way to do this.
Requirement is, update the user role for A to B for X users, and from C to D for Y users. If we can do first scenario for all users also fine but we know Y is very small group and we can update it manually.

Thanks.