How are users related to groups or roles?

Geeky
Kilo Guru

Can anybody answers this?

 

How are users related to groups or roles?

 

One to many relationships

Many to many relationships ?

5 REPLIES 5

peterwestergaar
Kilo Expert

Users (table sys_user) are related to Roles (table sys_user_role) with a many-to-many table (sys_user_has_role) which keeps records that each have a reference to one User and one Role.   When you add a Role directly to a User, a record is generated in the sys_user_has_role table.   When you remove a role from that User, the record is deleted.



Similarly, Groups (table sys_user_group) are related to Users with a many-to-many table (sys_user_grmember), which has records that each reference a single Group and a single User.



Does that help?


Thanks for the explanation Peter. Is it only a theoretical concept or can I see it?


Brad Tilton
ServiceNow Employee
ServiceNow Employee

In the related lists section on users, groups, and roles you can see the related lists, which are actually views of the relationship tables sys_user_grmember and sys_user_has_role. That allows you to actually look at the records on those tables.


Hi Brad,

If i want to create a replica relationship of Group on User table with the new and edit buttons how would i achieve it.

Can you help me ? , It would be great if you lead me in an appropriate direction.