what is the purpose of accumulated_roles field in the User table ?

Vijay Talupula
Tera Guru
Tera Guru

Guys,

I see that "accumulated_roles" field on the user table which has read & write field ACLs for "maint"   role only but don't see any purpose of it exposed anywhere in the system.

Questions:

=========

1) Can any one tell me why it has been created in the system and hidden even for admin ?

2) Can I use this field to populate the user roles (which are assigned to the user through Roles related list) for reporting purpose ?

The reason why I am asking is, I have to generate a report against the User table which has to include the user roles as well but the roles are adding to the User Role table (related list) rather than the Roles field (Glide List) which is on the User form.

1 ACCEPTED SOLUTION

Upon further testing, you are correct. The roles field is not auto-maintained by adding/removing groups in the related list. Similarly, the related list is not auto-maintained by adding/removing fields from the roles list field. I was under the impression that it was.



It wouldn't take much to write a business rule on sys_user_has_role table to keep the roles field updated and then make your report fairly simple as you originally requested.



Any time a record is added or deleted, you know the user, so update the record's field with which ever roles you find for that user in the table (accounting for uniqueness.) Don't forget, list fields are comma separated sys_ids so you'll need the sys_id of the role, which is easy enough since sys_user_has_role.role is a reference field and not a string.


View solution in original post

15 REPLIES 15

This got truncated some how.


But whatever the roles added using related list (User Roles table) are not


storing with this roles field but if I go with roles field on the form, it


is glide list type and will show the


The answer is, yes they do. If someone adds a role to the related list, the roles field is updated accordingly. You can report off that.


Hi Tomasi,



As per my understnading, if we add the roles in the related list, those


will not be added to the "Roles" field unless EITHER explicitly roles are


added through the form OR with script, copying from User Role table. Is


that correct ?



Could you please elaborate your latest comments once.



On May 30, 2017 10:52 PM, "ctomasi" <community-no-reply@servicenow.com>


Hi Tomasi,



@ The answer is, yes they do. If someone adds a role to the related list, the roles field is updated accordingly.



I don't think it happens OOB, do you meant that we need to write a script to do that ? or am I missing some thing ? Please clarify me.


@ctomasi, Can you please let me know your thoughts on this please ?


Upon further testing, you are correct. The roles field is not auto-maintained by adding/removing groups in the related list. Similarly, the related list is not auto-maintained by adding/removing fields from the roles list field. I was under the impression that it was.



It wouldn't take much to write a business rule on sys_user_has_role table to keep the roles field updated and then make your report fairly simple as you originally requested.



Any time a record is added or deleted, you know the user, so update the record's field with which ever roles you find for that user in the table (accounting for uniqueness.) Don't forget, list fields are comma separated sys_ids so you'll need the sys_id of the role, which is easy enough since sys_user_has_role.role is a reference field and not a string.