Notifications

75 views

Description

Symptoms


Illegal access to getter method getRoles in class com.glide.sys.User error when a form is submitted.

Release


Kingston and London 

Cause


This is caused if any of the business rules/script includes/ACLs uses the deprecated API "gs.getUser.roles".

Resolution


To get the string of roles that the user is assigned to, use the following script instead of gs.getUser.roles

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 + ",";
}

 

Article Information

Last Updated:2019-08-02 20:52:51
Published:2019-02-09