I believe the difference is addRoles() appends to the current roles list, and setRoles() overrides the current list with the one provided to the method.
System user functions - Ignition - Inductive Automation Forum
I believe the difference is addRoles() appends to the current roles list, and setRoles() overrides the current list with the one provided to the method.
System user functions - Ignition - Inductive Automation Forum