Form submission fails with error: Illegal access to getter method getRoles in class com.glide.sys.UserIssue A form submission fails with an error indicating illegal access to the getter method getRoles in class com.glide.sys.User, caused by the use of a deprecated API (gs.getUser.roles) in business rules, script includes, or ACLs. Symptoms Error when submitting a form.Illegal access to getter method getRoles in class com.glide.sys.User Release Release: Kingston and London Cause This error occurs if any business rules, script includes, or ACLs use the deprecated API gs.getUser.roles. Resolution To retrieve the user's roles instead of using the deprecated API, use the following script: Initialize an empty string to store role names: ```javascriptvar str = "";``` Query the sys_user_has_role table for the current user's roles: ```javascriptvar gr = new GlideRecord('sys_user_has_role');gr.addQuery('user', gs.getUser().getID());gr.query();``` Iterate through the results and concatenate role names: ```javascriptwhile (gr.next()) {str = str + gr.role.name + ",";}``` gs.getUser.rolessys_user_has_role var str = ""; var gr = new GlideRecord('sys_user_has_role') gr.addQuery('user',gs.getUser().getID()); gr.query() while(gr.next()){ str = str + gr.role.name + ","; }