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

Because of the ACLs being read/write for maint, it's not something you need to be concerned about. It obviously has a special purpose.



If you want access to roles without going to sys_user_has_role, take a look at the "roles" field. It IS available to admins.



Per that article, adding a role by modifying the value of the roles field is not supported. That field can be used as a "read-only" use of what is represented in the related list, but modifying that field does not necessarily modify the related list as far as I can tell.


Thanks again Chuck!


Hi Tomasi,



Actually my requirement is mentioned in the below screen shot, please have a look at it.



find_real_file.png



So, while digging into the system, I have seen this accumulated_roles field which seems to be useful for my report without creating any custom table or database view. Please let me know your thoughts.


It sounds like the 'roles' field is more what you are looking for. Then you can simply do a report on the sys_user table instead of a database view.


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



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