Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2016 04:24 PM
This is the script for adding roles to the user, which I copied from wiki. Can anyone explain what is accumulated_roles here and why we convert this to string?
var gr = new GlideRecord("sys_user");
gr.query();
while(gr.next()) {
if (gr.accumulated_roles.toString().indexOf(",self_service,") == -1) {
gr.roles = gr.roles + ",self_service";
gr.update();
}
}
Solved! Go to Solution.